Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the meaning for this error message

Status
Not open for further replies.

amarg

Programmer
Nov 19, 2002
106
IN
Hi,

From one of my fatch statement i am getting the following error.

Msg:ORA-01002: fetch out of sequence.

I am not a proper user of Oracle. I am just using some of the sql statement to fatch the data from database and doing some manupulation. Please give me the reason in which cases we can get the above error message.

Thanks,
Amar
 
The documentation states....

--------------------

ORA-01002 fetch out of sequence

Cause: In a host language program, a FETCH call was issued out of sequence. A successful parse-and-execute call must be issued before a fetch. This can occur if an attempt was made to FETCH from an active set after all records have been fetched. This may be caused by fetching from a SELECT FOR UPDATE cursor after a commit. A PL/SQL cursor loop implicitly does fetches and may also cause this error.

Action: Parse and execute a SQL statement before attempting to fetch the data.
------------------

I hope that helps

James

 
The most probable reason is ending transaction within FOR UPDATE loop. Sometimes it may also happen when you loose connect to one Oracle Instance and then restore it on another (OPS). There was also a bug with calling dynamic sql from Forms.

Regards, Dima
 
Hi,

Thanks sam, I was the Oracle bug. I found the document from the Oracle. Bug is if i am going the rollback from the savepoint Oracle is closing the Cursor also. I am going to open it again if this.

Regards,
Amar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top