Google+

Friday, October 8, 2010

A NOCYCLE sequence

 A NOCYCLE sequence

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

Sequence created.

  A NOCYCLE sequence

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

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

SQL> select studentNumSeq.nextVal from dual;
select studentNumSeq.nextVal from dual
  *
ERROR at line 1:
ORA-08004: sequence STUDENTNUMSEQ.NEXTVAL exceeds MAXVALUE and cannot be instantiated


SQL> select studentNumSeq.nextVal from dual;
select studentNumSeq.nextVal from dual
*
ERROR at line 1:
ORA-08004: sequence STUDENTNUMSEQ.NEXTVAL exceeds MAXVALUE and cannot be instantiated


SQL>
SQL>
SQL> drop sequence studentNumSeq;

Sequence dropped.


Note:-Please comment and reply me.

0 comments:

Post a Comment