Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Sequences
 

Once initialized, you can get the current value from the sequence using currval

SQL> SQL> CREATE SEQUENCE test_seq; Sequence created. SQL> SQL> SELECT test_seq.nextval FROM dual;    NEXTVAL ----------          1 SQL> SQL> SELECT test_seq.currval FROM dual;    CURRVAL ----------          1 SQL> SQL> drop sequence test_seq   2  / Sequence dropped. SQL>