|
Guys, I have been pulling my hair out with this and I hope you can help me with it.
Below is the code to an SQLRPGLE program and a stored procedure.
The program calls the Stored Procedure pass First and Last Name. The SP returns a result set. I am getting an SQL error SQL0504
Stating that I have not declared the cursor but it gets declared in the ALLOCATE statement. See below highlighted in yellow.
Dcl-S MyResultSet SQLTYPE(RESULT_SET_LOCATOR);
EXEC SQL CALL uspGetMatch(:ADFNAME, :ADLNAME); //Stored Procedure
Exec SQL
ASSOCIATE RESULT SET LOCATORS
(:MyResultSet)
WITH PROCEDURE uspGetMatch;
Exec SQL
ALLOCATE MYCURSOR CURSOR
FOR RESULT SET :MyResultSet;
Exec SQL
Open MYCURSOR;
SQL0504: Position 23 Cursor MYCURSOR not declared.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.