SEQUENCE

|



CREATE SEQUENCE emp_seq START WITH 1 INCREMENT BY 1 MAXVALUE 100000;


INSERT INTO emp(empno, ename, hiredate ) VALUES

(emp_seq.NEXTVAL, 'julia' , sysdate); 


SELECT emp_seq.CURRVAL FROM DUAL;


SELECT emp_seq.NEXTVAL FROM DUAL; 



ALTER SEQUENCE emp_seq INCREMENT BY 2 CYCLE;



DROP SEQUENCE emp_seq; 

'DB' 카테고리의 다른 글

SEQUENCE  (0) 2013.12.12
using DAYS from DB2  (0) 2013.10.20
Trackback 0 And Comment 0
prev | 1 | 2 | 3 | 4 | 5 | next