Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ORA-01002 Fetch out of Sequence

Status
Not open for further replies.

cfehr

Programmer
Oct 18, 2002
3
CA
Hi, All:

I modified little in Sample10.pc of PRO*C sample code to fit both NT and
Linux using 8i version precompiler, with VC++ and GCC Compiler respectively.
All process were fine when they connected to a DB Server(8i version), but
when they connected to the other Server(8 version), the error : ORA-01002
(Fetch out of sequence) was always issued at run-time. I checked the error
message and found that the program was stuck on the "PREPARE" description. I
have spent much more time debugging, but it still didn't work. Could you
help me?
 
You will receive this error in Oracle 8 when the code does a commit during the cursor loop ie the following pseudo code

OPEN c_Cursor
FETCH c_Cursor INTO v_CurRec
While c_Cursor%FOUND LOOP
Update where current of c_Cursor
COMMIT
Fetch will now fail with out of sequence
END LOOP
 
I am not getting the error on fetch. I get the error when I do a Prepare statement. I am also do not commit until the end of the program.
 
This certainly looks like a version mismatch. Metalink has a reference to bug 644413, which affects Pro*C 8i applications running on Oracle 8 databases. This bug was supposed to be fixed in 8.0.6.1, so if you are running anything earlier, that may be your problem.
 
Thanks Karluk! That was very useful.
I am now try to install Oracle 8.0.6 with pro*c/c++ on my windows 2000 PC. However when I install all the files for the database server on my PC I don't get anything in PRO80. Do you have any idea how to get that older version of pro*c/c++ on my pc?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top