Home » SQL & PL/SQL » SQL & PL/SQL » sequence .CURRVAL is not yet defined in this session
sequence .CURRVAL is not yet defined in this session [message #21201] Wed, 17 July 2002 22:15 Go to next message
Ajay Kumar Misra
Messages: 2
Registered: July 2002
Junior Member
When I am trying to get the currval of sequence(employee_seq.CURRVAL) calling PL/SQL block
THROUGH ASP PAGE, it gives me the following error

ORA-08002: sequence employee_seq.CURRVAL is not yet defined in this session

the sequence is having currval as 5 in backend. I am not using employee_seq.nextval in PL/SQL.

How can I solve this problem.
Re: sequence .CURRVAL is not yet defined in this session [message #21207 is a reply to message #21201] Thu, 18 July 2002 00:18 Go to previous messageGo to next message
Ravi
Messages: 251
Registered: June 1998
Senior Member
You can't use currval if you have not used nextval in the session. once you have used nextval then in that session you can use currval.
Re: sequence .CURRVAL is not yet defined in this session [message #21228 is a reply to message #21207] Thu, 18 July 2002 20:54 Go to previous message
Ajay Kumar Misra
Messages: 2
Registered: July 2002
Junior Member
What I wanted was, to get the Last Sequence Value Generated for Employees by Sequence EMPLOYEE_SEQ.

I have got the code. which is as follows.

SELECT last_number - increment_by currval FROM user_sequences
WHERE SEQUENCE_NAME = 'EMPLOYEE_SEQ';
Previous Topic: Net 8 problem
Next Topic: Re: To Retrieve a single row ; Urgent
Goto Forum:
  


Current Time: Sat Aug 23 15:29:58 CDT 2025