Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Sequences
 

Creating a sequence and then get the next value

SQL> SQL> CREATE SEQUENCE test_seq; Sequence created. SQL> SQL> SELECT test_seq.nextval FROM DUAL;    NEXTVAL ----------          1 SQL> SELECT test_seq.nextval FROM DUAL;    NEXTVAL ----------          2 SQL> SELECT test_seq.nextval FROM DUAL;    NEXTVAL ----------          3 SQL> SQL> DROP SEQUENCE test_seq; Sequence dropped. SQL>