Hi,

I am having a problem with Oracle Sequences.

These are the steps how I encountered the problem

CREATE OR REPLACE SEQUENCE TEST_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 25 MINVALUE 0

SELECT TEST_SEQ.NEXTVAL FROM DUAL;
NEXTVAL
----------
1
...
SELECT TEST_SEQ.NEXTVAL FROM DUAL;
NEXTVAL
----------
20

SELECT TEST_SEQ.CURRVAL FROM DUAL;
CURRVAL
----------
20

DROP SEQUENCE TEST_SEQ;
TEST_SEQ DROPPED.

CREATE OR REPLACE SEQUENCE TEST_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 25 MINVALUE 0;
TEST_SEQ CREATED.

SELECT TEST_SEQ.CURRVAL FROM DUAL;
CURRVAL
----------
20

I am in the same session.Eventhough I dropped the sequence and created again the currval is not flushed from the session.
And if you query for NEXTVAL from there onwards the CURRVAL is initialized. Is this sequence bahaviour a bug? Because all other objects if they are dropped doesnt have the same behaviour like this sequence.

Your comments are greatly appreciated.

Thanks In Advance.
Sekhar Modem.





[Edited by s_modem on 05-10-2002 at 06:13 PM]