Mega Code Archive

 
Categories / Oracle PLSQL / Sequence
 

Sequence max value

SQL> SQL> SQL> -- If you omit the MAXVALUE option, your sequence will automatically default to: SQL> SQL>    --  MAXVALUE 999999999999999999999999999 SQL> SQL> -- So you can simplify your CREATE SEQUENCE command as follows: SQL> SQL>     CREATE SEQUENCE mySequence   2          MINVALUE 1   3          START WITH 1   4          INCREMENT BY 1   5          CACHE 20; Sequence created. SQL> SQL>     select mySequence.nextval from dual;    NEXTVAL ----------          1 SQL> SQL> SQL>     drop sequence mySequence; Sequence dropped. SQL>