본문 바로가기

[Oracle] Insert와 commit

131ZIPDAN 발행일 : 2017-06-14
반응형
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 
-- * member table * 
-- 데이터 입력
-- id:zipdan, name:진훋구, age:31, tel:010-1212-2121
 
insert into member(id,name,age,tel)
values('zipdan','진훋구',31,'010-1212-2121');
 
-- 위에 문장은 DB에 완전 적용된게 아니고 작업문자으로 남게 된다.
-- 그러므로 DB에 완전 적용(commit)을 하여 다른 처리자가 처리를 할 수 있게 한다.
commit;
 
-- 데이터 입력
-- id:zipdan, name:일삼일, age:13, tel:010-1111-1111
insert into member(id,name,age,tel) 
values('zipdan','일삼일',13,'010-1111-1111');
commit;
 
-- 데이터 입력
-- id:zipdan, name:일삼일
-- 컬럼 중에서 not null은 필수 입력이고 나머지는 생략할 수 있다.
insert into member(id,name) values('zipdan','일삼일');
commit;
 
-- 데이터 입력
-- id:hood, name:후드, age:31, tel:010-3333-4444
-- data를 DB의 컬럼 순서에 맞게 모든 데이터를 입력하는 경우
-- table명 뒤에 나오는 컬럼명은 생략할 수 있다.
insert into member values('jang','장철호',25,'010-3333-4444');
commit;
 
-- id, name, age, tel 조회
select id,name,age,tel from member;
 
 
cs

 

반응형

'Programming > Oracle' 카테고리의 다른 글

[Oracle] lock 해제  (0) 2017.08.03
[Oracle] 사용자 및 테이블 생성,삭제  (0) 2017.06.08
[oracle] Table 쿼리  (0) 2017.06.07
ORACLE 게시판 기본 활용 sql query  (0) 2017.05.19

댓글