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

Thread: Sequences

  1. #1
    Join Date
    Apr 2003
    Location
    Delhi
    Posts
    51

    Sequences

    Hi All,
    I m facing a problem when I am trying to access a sequence currval
    eg SEQ_XYZ.CURRVAL in a query like
    select SEQ_XYZ.CURRVAL from dual ;
    an error is raised
    ORA-08002: sequence SEQ_ST_ORDER_ID.CURRVAL is not yet defined in this session
    but when I print nextval of this sequence & then its currval then it runs fine.
    Any idea.

    regards
    Nik
    regards
    nik

  2. #2
    Join Date
    Jul 2002
    Location
    Slovenia
    Posts
    42
    When you start session you need first to query for nextval and then currval

    there is no currval of sequence in your session when you start session

    SELECT SEQ_XYZ.NEXTVAL FROM dual ;

    SELECT SEQ_XYZ.CURRVAL FROM dual ;
    Andrej

  3. #3
    Join Date
    Apr 2003
    Location
    Delhi
    Posts
    51
    thanx a lot got it.


    When you start session you need first to query for nextval and then currval

    there is no currval of sequence in your session when you start session

    SELECT SEQ_XYZ.NEXTVAL FROM dual ;

    SELECT SEQ_XYZ.CURRVAL FROM dual
    regards
    nik

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