● 시퀀스 ( Sequence ) > ORACLE

본문 바로가기

사이트 내 전체검색

뒤로가기 ORACLE

● 시퀀스 ( Sequence )

페이지 정보

작성자 관리자 작성일 23-04-19 15:41 조회 639 댓글 0

본문

 Mysql 에는 auto_increment 속성이 있어 자동으로 + 1 처리를 해주지만 ORACLE 에서는 시퀀스를 이용해서 처리 --



CREATE TABLE NOTICE2 (

id NUMBER not null, 

title NVARCHAR2(200) not null,

content CLOB not null,

writer NVARCHAR2(20) not null,

signdate TIMESTAMP default sysdate,

hit NUMBER default 0,

files NVARCHAR2(500) null

);



create SEQUENCE notice2_seq;


eb0296137fc37ad8a7de9b3ab587b744_1682035773_5893.png
 


insert into notice2 (id,title,content,writer) values(notice2_seq.nextval,'제목1','내용1','1111');

insert into notice2 (id,title,content,writer) values(notice2_seq.nextval,'제목2','내용2','1111');

insert into notice2 (id,title,content,writer) values(notice2_seq.nextval,'제목3','내용3','1111');



select * from notice2;


18bb88d64b15ed3827f1f56d441458b4_1681887168_2915.png

 

추천0 비추천 0

댓글목록 0

등록된 댓글이 없습니다.


Copyright © dancePKT. All rights reserved.
PC 버전으로 보기