Skip to content
February 24, 2011 / doganay

Oracle/PLSQL: ORA-08002 Error

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Hi,

Error:

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

You tried to execute a CURRVAL command on a sequence before the NEXTVAL command was executed at least once.
Action:

The options to resolve this Oracle error are:
Try executing the NEXTVAL command for the sequence, initially. Then call the CURRVAL command.

if you use this syntax, you will receive our error: ora-08002
SELECT my_sequence.CURRVAL
FROM dual;

well, just user nextval:

SELECT my_sequence.nextval
FROM dual;

and now, you can select currval:

SELECT my_sequence.CURRVAL
FROM dual;

try and pray 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: