Oracle Database Object: Sequence
Database Objects: Sequence
create sequence dept_deptno
INCREMENT BY
1
START WITH 91
MAXVALUE 100
NOCACHE
NOCYCLE;
Sql> ALTER SEQUENCE dept_deptno
INCRREMENT BY
1
MAXVALUE
10000
NOCACHE
NOCYCLE;
SQL> DROP SEQUENCE dept_deptno;
Insert value using sequence
Sql> INSERT INTO dept(deptno, dname, loc)
VALUES(dept_deptno.nextval,
’Marketting’, ’San Diego’);
Sql> SELECT dept_deptno.currval FROM
dual;
Comments
Post a Comment