Re: Pro*C cursor problem

From: Ashok Upadhyay <aupadhya_at_earthlink.net>
Date: Tue, 17 Nov 1998 14:52:13 GMT
Message-ID: <36518CA4.78E0702D_at_earthlink.net>


This error normally comes when you try to fetch record when end of the file (Table) is reached. Somewhere in your logic you are missing (Sqlca.sqlcode = 1403) check before you fetch next record. Hope this helps.
Thanks
Ashok

Jon Clendenen wrote:

> I have a problem with a Pro*C application that I have upgraded from
> version 1 to version 2. The code has three nested cursors that are used
> to build a set of files for input to a different system. This code has
> worked for over a year on the old system, and has been migrated
> successfully in its compiled form to a new system. I have had to make a
> change in formatting of a date field to YYYY instead of YY, and need to
> recompile on the new system. I got a 'Fetch out of Sequence' error.
>
> The old code compiled on the old system will run on the new system
> properly, but when the same code is compiled successfully on the new
> system I get a 'Fetch Out of Sequence' error on the first cursor. Any
> ideas what is the problem here? I'm stumped.
>
> The logic is:
> declare cursor_A
> open cursor_A
> fetch cursor_A into variables_A
> write variables_A to file
> declare cursor_B
> open Cursor_B
> fetch cursor_B into variables_B
> write variables_B to file
> declare cursor_C
> open Cursor_C
> fetch cursor_C into variables_C
> write variables_C to file
> fetch cursor_C into variables_C
> write variables_C to file
> fetch cursor_C into variables_C
> write variables_C to file (to end of cursor)
> close cursor_c
> (go back to cursor_B
> fetch next row and write it
> go to cursor_C again
> repeat to end of cursor_B
> close cursor_B
> then fetch next row of cursor_A
> repeat process finally closing cursor_A and then updating the database
> to set flag for PROCESSED)
Received on Tue Nov 17 1998 - 15:52:13 CET

Original text of this message