I wrote an RPG program that will call my stored procedure, which has both input and output fields as well as a results set, to test the stored procedure. I used the following code to call the SP and it works terrific. I load the results set data into a subfile and display it. The problem is that I cannot call the stored procedure a second time. When I do I get this error "Cursor C1 already assigned to result set." I did a little research and have tried and tried to use DEALLOCATE DESCRIPTOR, but clearly I am not doing it correctly, if indeed that is what I should be doing.
And I know I should be using iSeries Navigator to test this (ACS), and I do.
I am writing this program so that my QA folks, who do not have access to ACS (for whatever reason) can run the stored procedure tests as they require.
Any help is greatly appreciated!
c/Exec SQL
c+ Call MY_STOREDPROC (arm1, arm2, arm3)
c+End_Exec
c/Exec SQL
c+ Associate Result Set Locators (:Results_Set)
c+ With Procedure MY_STOREDPROC
c/End-Exec
c/Exec SQL
c+ Allocate C1 Cursor for Result Set :Results_Set
c/End-Exec
c/Exec SQL
c+ Fetch Next from C1 into :Results_Data
c/End-Exec
And I know I should be using iSeries Navigator to test this (ACS), and I do.
I am writing this program so that my QA folks, who do not have access to ACS (for whatever reason) can run the stored procedure tests as they require.
Any help is greatly appreciated!
c/Exec SQL
c+ Call MY_STOREDPROC (arm1, arm2, arm3)
c+End_Exec
c/Exec SQL
c+ Associate Result Set Locators (:Results_Set)
c+ With Procedure MY_STOREDPROC
c/End-Exec
c/Exec SQL
c+ Allocate C1 Cursor for Result Set :Results_Set
c/End-Exec
c/Exec SQL
c+ Fetch Next from C1 into :Results_Data
c/End-Exec
Comment