Creating a sequence and then get the next value : Create Sequence « Sequences « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE SEQUENCE test_seq;

Sequence created.

SQL>
SQL> SELECT test_seq.nextval FROM DUAL;

   NEXTVAL
----------
         1

SQL> SELECT test_seq.nextval FROM DUAL;

   NEXTVAL
----------
         2

SQL> SELECT test_seq.nextval FROM DUAL;

   NEXTVAL
----------
         3

SQL>
SQL> DROP SEQUENCE test_seq;

Sequence dropped.

SQL>
SQL>








5.1.Create Sequence
5.1.1.Sequences
5.1.2.Create the simplest sequence
5.1.3.Creating a sequence and then get the next value
5.1.4.Test sequence step
5.1.5.CREATE SEQUENCE test_seq;
5.1.6.Using a sequence to populate a table's column
5.1.7.create sequence deptno_seq start with 50 increment by 10
5.1.8.Create a sequence starting with '100000000 order'
5.1.9.Create a sequence
5.1.10.CREATE SEQUENCE myTableIDSeq INCREMENT BY 1 START WITH 1000;
5.1.11.Create a sequence starting with 1000
5.1.12.create sequence emps_seq start with 501 increment by 10