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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net Express - Oracle testing: Duplicate cursor name

Status
Not open for further replies.

jessicatx

Programmer
Oct 14, 2002
28
0
0
US
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

 
I believe that it is. Perhaps I should post it elsewhere? It is in a COBOL program. Does no one else do SQL in a COBOL program?
 
ssuming that COBOL is involved in this somehow, make sure that COBOL record layouts (INVOKE) match SQL's. Because of the way SQL code is compiled and linked with COBOL code, the possibility of SQL stepping all over your COBOL buffers is very high.

Also, if the pattern of failure is consistent (after 14, after 7), then, again, look at the data.

Dimandja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top