Okay - so I've written a tiny program that accesses three tables and I have tested it using Net Express's Animator. I am getting an error: Duplicate cursor name. Cannot see what I am doing wrong. My "driver" table is being read in a certain sequence. Then I open Cursor 1 and do a fetch. Cursor 1 will read an Open Item using the Invoice Nbr + Customer Nbr that was retrieved by the driver table. Next I open Cursor 2 and do fetches until no more rows satisfy the criteria (SQLCODE = 100). Cursor 2 looks for any applied payments against this same Invoice Nbr + Customer Nbr. I then close both Cursor 1 and Cursor 2 and continue with the next fetch from the "driver" cursor.
It is very tedious to step thru every piece of code (until I get this failure), so I am debugging by writing to a text file, before and after every Exec SQL (and also after I have checked the SQLCODE!). I generally place the paragraph name + an identifying number in each output record, so I can "walk" through the code after the failure occurs. I cannot see where I am bypassing any necessary error handling (where SQLCODE checking occurs). The main cursor is only opened at the start of the program, then the rest of the application is a series of Performs.
The Duplicate Cursor Name gives an SQLCODE of -00000001 (give or take a few zeroes) and SQLWARN1 thru SQLWARN4 are all blanks.
I have tried this process with two tables and with three tables. When retrieving from 3 tables, I err out after the 7th driver record, and with only 2 tables, I err out after the 14th driver record.
Also: do I need to have the driver table set up as a cursor? (I am currently using it that way.) It is not subject to update (only reading this table), but I want to read it in a given sequence. Should I substitute an ordinary Select, with an Order By option?
The Oracle data base is on an NT server. I am working under WIN2K. I believe we are on Oracle 8.I.
Thanks in advance for any suggestions.
Jessica
It is very tedious to step thru every piece of code (until I get this failure), so I am debugging by writing to a text file, before and after every Exec SQL (and also after I have checked the SQLCODE!). I generally place the paragraph name + an identifying number in each output record, so I can "walk" through the code after the failure occurs. I cannot see where I am bypassing any necessary error handling (where SQLCODE checking occurs). The main cursor is only opened at the start of the program, then the rest of the application is a series of Performs.
The Duplicate Cursor Name gives an SQLCODE of -00000001 (give or take a few zeroes) and SQLWARN1 thru SQLWARN4 are all blanks.
I have tried this process with two tables and with three tables. When retrieving from 3 tables, I err out after the 7th driver record, and with only 2 tables, I err out after the 14th driver record.
Also: do I need to have the driver table set up as a cursor? (I am currently using it that way.) It is not subject to update (only reading this table), but I want to read it in a given sequence. Should I substitute an ordinary Select, with an Order By option?
The Oracle data base is on an NT server. I am working under WIN2K. I believe we are on Oracle 8.I.
Thanks in advance for any suggestions.
Jessica