Home » RDBMS Server » Networking and Gateways » ora - 01002 Fetch out of sequence
ora - 01002 Fetch out of sequence [message #252867] Fri, 20 July 2007 07:52 Go to next message
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 #252878 is a reply to message #252867] Fri, 20 July 2007 08:14 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
asap

Nothing urgent here but you reading the stickies before posting.
For instance, why do you think Oracle version is irrelevant (on both side with 4 decimals)?
Or why do you think telling us which tool you use to execute the query is irrelevant?
Or why copying and pasting your screen is irrelevant?

Without accurate information you can't have accurate answer.
Here what we can say: It may or may not be a bug.

Regards
Michel


Re: ora - 01002 Fetch out of sequence [message #252893 is a reply to message #252878] Fri, 20 July 2007 09:03 Go to previous messageGo to next message
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 Go to previous message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
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

Previous Topic: Security risk to Listener service
Next Topic: Not able to locate listner.ora, tnsnames.ora files
Goto Forum:
  


Current Time: Fri Dec 02 20:58:42 CST 2016

Total time taken to generate the page: 0.11112 seconds