Google+

Friday, August 6, 2010

Sequence Example 1


SQL> CREATE SEQUENCE supplier_seq
  2 MINVALUE 1
  3 MAXVALUE 999999999999999999999999999
  4 START WITH 1
  5 INCREMENT BY 1
  6 CACHE 20;

Sequence created.

SQL>
SQL> select supplier_seq.nextval from dual;

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

SQL> select supplier_seq.nextval from dual;

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

SQL> select supplier_seq.nextval from dual;

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

SQL> select supplier_seq.nextval from dual;

  NEXTVAL
----------
  4

SQL>
SQL> drop sequence supplier_seq;

Sequence dropped.



Note:- Please comment and reply me.

1 comment: