Q
Problem solve Get help with specific problems with your technologies, process and projects.

ORA-01002: fetch out of sequence error

Actually, one of our customers is using Oracle 9.2 as a back end. He tried to retrieve data from a table using...

a simple SELECT (select * from state) statement. He got an error message saying that "ORA-01002: fetch out of sequence". At the same time, I have tried on my machine using SQL*Plus, and also Frontend. It works fine for me by using both. What could be the reasons to get this kind of error message using a simple select statement?  

Are you sure he is not running the Select statement as part of a cursor? Usually you will get the error if you are attemping to execute a commit on the rows retrieved by the SQL statement without specifying a FOR UPDATE clause or if you are attempting to execute the statement again even after the last row has been retrieved by the cursor (in this case the cursor is defined as select * from state according to your example).
 

This was last published in October 2004

Dig Deeper on Using Oracle PL-SQL

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close