Home » RDBMS Server » Server Administration » ORA-01002 Fetch Out of Sequence Error
ORA-01002 Fetch Out of Sequence Error [message #57938] Mon, 21 July 2003 10:18 Go to next message
P.V.Rao
Messages: 6
Registered: May 2003
Junior Member
I am getting ORA-01002 Fetch Out of Sequence error from both front and backends. Even when i am executing simple select statements from SQL Prompt the above error is coming frequently. The same query is executing correctly after sometime. I am using 8i database, Forms 4.5 and Reports 2.5.

Please give me some solution to overcome above problem

Regards,

P.V.Rao
Re: ORA-01002 Fetch Out of Sequence Error [message #57940 is a reply to message #57938] Mon, 21 July 2003 11:46 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
fetch out of sequence mostly occurs with 'for update cursors' which should handled programmatically.
Please post in pl/sql forum..some one may have a better control over it.

Re: ORA-01002 Fetch Out of Sequence Error [message #212936 is a reply to message #57938] Mon, 08 January 2007 20:21 Go to previous messageGo to next message
bambam
Messages: 1
Registered: January 2007
Junior Member
I am also experiencing the same problems, whereby sometimes the error message occurs and sometimes it dont, with the same set of simple SQL statements (without any for updates and commit clauses etc) used. Using the same Forms and reports version like u but backend is version 7 database.

Also seeking advice on how to solve this.
Re: ORA-01002 Fetch Out of Sequence Error [message #213000 is a reply to message #212936] Tue, 09 January 2007 01:39 Go to previous message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This is what Oracle says about the error. Do you find yourself in here?
Quote:
ORA-01002: fetch out of sequence

Cause: This error means that a fetch has been attempted from a cursor which is no longer valid. Note that a PL/SQL cursor loop implicitly does fetches, and thus may also cause this error. There are a number of possible causes for this error, including: 1) Fetching from a cursor after the last row has been retrieved and the ORA-1403 error returned. 2) If the cursor has been opened with the FOR UPDATE clause, fetching after a COMMIT has been issued will return the error. 3) Rebinding any placeholders in the SQL statement, then issuing a fetch before reexecuting the statement.

Action: 1) Do not issue a fetch statement after the last row has been retrieved - there are no more rows to fetch. 2) Do not issue a COMMIT inside a fetch loop for a cursor that has been opened FOR UPDATE. 3) Reexecute the statement after rebinding, then attempt to fetch again.
Previous Topic: what is difference between rowlevel trigger and statement level trigger
Next Topic: SPFILE ERROR
Goto Forum:
  


Current Time: Thu Dec 08 06:35:38 CST 2016

Total time taken to generate the page: 0.10545 seconds