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;

 SELECT * from user_sequences;

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

Popular posts from this blog

How to be an Innovative Speaker?

Developing Personal Skills

Differences between the terms Science, Technology, and Engineering