Home > Ask the Oracle Database / Applications Experts > Questions & Answers > Resolving the ORA-01002 error
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

Resolving the ORA-01002 error

Karen Morton EXPERT RESPONSE FROM: Karen Morton

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site
>
QUESTION POSED ON: 11 August 2003
I am working as an Oracle/VB programmer. I am trying to lock a record using "FOR UPDATE NOWAIT" statement. For example, when I open a recordset with
select * from emp where empno =1 for update nowait
I get the error:
ORA-01002: fetch out of sequence
This statement works fine if the record is already locked by some other user through other sessions. When the record is not locked, the above statement should lock the record. In this case it's giving the error. Please help me find the solution.

>

Here's the Oracle Error Messages guide description of this error:

In a host language program, a FETCH call was issued out of sequence. A successful parse-and-execute call must be issued before a fetch. This can occur if an attempt was made to FETCH from an active set after all records have been fetched. This may be caused by fetching from a SELECT FOR UPDATE cursor after a commit. A PL/SQL cursor loop implicitly does fetches and may also cause this error.
Since you're doing this from VB, the way it's being called may be the problem. Check your code for sequencing of steps.

For More Information


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Oracle White Papers: Fusion Middleware
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts