CREATE table tbl_book (
seqno NUMBER,
title VARCHAR2(300) NOT NULL,
writer VARCHAR2(100) NOT NULL,
regdate DATE DEFAULT SYSDATE,
updatedate DATE DEFAULT sysdate
);
ALTER TABLE tbl_book ADD CONSTRAINT pk_book PRIMARY KEY (seqno);
CREATE SEQUENCE seq_book;
INSERT INTO tbl_book (seqno, title, writer )
VALUES (SEQ_BOOK.NEXTVAL, 'The old man and the sea', 'Honest Hamingway');
SELECT * FROM tbl_book;
INSERT INTO tbl_book(seqno, title,writer) (SELECT SEQ_BOOK.NEXTVAL, title, writer FROM tbl_book);
댓글 없음:
댓글 쓰기