A CYCLE sequence : Sequence Properties « Sequence « Oracle PL / SQL






A CYCLE sequence



SQL>
SQL> -- A CYCLE sequence
SQL>
SQL>
SQL> CREATE SEQUENCE StudentNumSeq
  2    INCREMENT BY 50000
  3    START WITH 50000
  4    MAXVALUE   99999
  5    NOCACHE
  6    CYCLE;

Sequence created.

SQL>
SQL>
SQL> select studentNumSeq.nextVal from dual;

   NEXTVAL
----------
     50000

SQL> select studentNumSeq.nextVal from dual;

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

SQL> select studentNumSeq.nextVal from dual;

   NEXTVAL
----------
     50001

SQL>
SQL>
SQL> drop sequence studentNumSeq;

Sequence dropped.

SQL>
SQL>
           
       








Related examples in the same category

1.Sequence cache option
2.A NOCYCLE sequence