Home » SQL & PL/SQL » SQL & PL/SQL » ORA-01002 (Oracle 10G)
ORA-01002 [message #317614] Fri, 02 May 2008 03:25 Go to next message
Messages: 540
Registered: February 2008
Senior Member

i just copied one procedure created by my dad... I just
change the table name of my need....

cursor c1 is select * from bill_mast for update of bill_val;
c1val is c1%rowtype;

while i executing the error Ora error 1002 raised and said
fetch sequenciing is wrong...

while reading the error definition, i found that parse and execute command causes this error...

what does it mean by parse...

the mentioned procedure is very big one and successfully running
in dad's application.

i just included the word of for update of...

is this syntax is wrong...

Re: ORA-01002 [message #317616 is a reply to message #317614] Fri, 02 May 2008 03:33 Go to previous message
Michel Cadot
Messages: 63923
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The FOR UPDATE you add is the root of the problem as the description of the error mentions it:
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: remove blank spaces
Next Topic: update blob field
Goto Forum:

Current Time: Wed Oct 26 01:07:24 CDT 2016

Total time taken to generate the page: 0.14691 seconds