You have to check if your sequence is cached. The "CACHE_SIZE" field on user|all|dba|sequences show if it is and the "CACHE_SIZE" field show the cache size. If your database just hung you will lost any cache sequence number.
Use SEQUENCE_NAME.CURRVAL.
SQL> select tamil_seq.nextval from dual;
NEXTVAL
----------
2
SQL> select tamil_seq.currval from dual;
CURRVAL
----------
2
CURRVAL will work only after you executed nextval, oherwise you will get an error:
SQL> select tamil_seq.currval from dual;
select tamil_seq.currval from dual
*
ERROR at line 1:
ORA-08002: sequence TAMIL_SEQ.CURRVAL is not yet defined in this session
Tamil
Last edited by tamilselvan; 01-02-2007 at 10:45 AM.
Bookmarks