ORA-08002: sequence NAME.CURRVAL is not yet defined in this session [message #209392] |
Thu, 14 December 2006 09:32  |
frank.svs
Messages: 162 Registered: February 2006
|
Senior Member |
|
|
Hi frns,
I am getting the following error repeatedly eventhough i called the seq.nextval first and then i invoked seq.currval? why?
Error:
ORA-08002: sequence NAME.CURRVAL is not yet defined in this session
Do i need to set any parameter at database level to persist the
previous nextval of the sequence. Because what i found is that,
the sequence is getting incremented but when i close and open a new session again i am getting the above error.Why?
Because i am facing this error quite oftenly on Production Box.
Waiting for reply.
Thanks and Regards,
frank
|
|
|
Re: ORA-08002: sequence NAME.CURRVAL is not yet defined in this session [message #209393 is a reply to message #209392] |
Thu, 14 December 2006 09:37   |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
I'm afraid this is one of those cases where you need to read the error message more closely, and then read your own description of what you're doing, and then go 'Ahhhh!'.
I'll highlight the key points for you:
Error:
ORA-08002: sequence NAME.CURRVAL is not yet defined in this session
And:
but when i close and open a new session again i am getting the above error
|
|
|
|
|
|
Re: ORA-08002: sequence NAME.CURRVAL is not yet defined in this session [message #210736 is a reply to message #209392] |
Fri, 22 December 2006 02:14   |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Ok, I'll go through this slowly.
Sequence.CURRVAL only has any meaning in a session if you have previously used NEXTVAL on that sequence in that session.
If you close down your session and open another session, then until you use NEXTVAL in that new session, CURRVAL cannot be used.
You say thatwhen i close and open a new session again i am getting the above error
This is the reaseon why - you cannot use CURRVAL in a session until you have used NEXTVAL
|
|
|
|