ora - 01002 Fetch out of sequence [message #252867] |
Fri, 20 July 2007 07:52 |
sanjaykumar.patel@tcs.com
Messages: 1 Registered: July 2007
|
Junior Member |
|
|
Hi All,
I don't know why I m getting the fetch out of sequence error. This error coming when I am going to insert into table via select statement. i.e .. insert inot tbl1 (select * from tbl2)
In my select statement I am retriving data from view through the database link. Its implicit cursor. Its simple sql statement , not through plsql. Plese do needful asap. Thanks
|
|
|
|
Re: ora - 01002 Fetch out of sequence [message #252893 is a reply to message #252878] |
Fri, 20 July 2007 09:03 |
DreamzZ
Messages: 1666 Registered: May 2007 Location: Dreamzland
|
Senior Member |
|
|
without having sufficient information we go 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
|
[Updated on: Fri, 20 July 2007 09:03] Report message to a moderator
|
|
|
Re: ora - 01002 Fetch out of sequence [message #252911 is a reply to message #252893] |
Fri, 20 July 2007 10:51 |
|
Michel Cadot
Messages: 68728 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
None of these has a relation with the posted basic statement:
Quote: | insert inot tbl1 (select * from tbl2)
|
The keyword in this case is: database link.
Regards
Michel
|
|
|