Test sequence step : Create Sequence « Sequences « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE SEQUENCE test_seq
  2  START WITH 10 INCREMENT BY 5
  3  MINVALUE 10 MAXVALUE 20
  4  CYCLE CACHE 2 ORDER;

Sequence created.

SQL>
SQL>
SQL> SELECT test_seq.nextval FROM dual;

   NEXTVAL
----------
        10

SQL>
SQL> SELECT test_seq.nextval FROM dual;

   NEXTVAL
----------
        15

SQL>
SQL> SELECT test_seq.nextval FROM dual;

   NEXTVAL
----------
        20

SQL>
SQL> SELECT test_seq.nextval FROM dual;

   NEXTVAL
----------
        10

SQL>
SQL>
SQL> drop sequence test_seq
  2  /

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