DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 24

Thread: to find last number generated for sequence object

Threaded View

  1. #4
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    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 11:45 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width