View previous topic :: View next topic
|
Author |
Message |
Robin Sulsona
New User
Joined: 14 Dec 2015 Posts: 10 Location: United States
|
|
|
|
I have a COBOL program (RSJUNK) that is calling a Stored Procedure (SPJUNK). The Stored Procedure is building my GTT and when I am done I open a cursor that is defined "WITH RETURN TO CALLER" as part of the DECLARE.
When I return to RSJUNK, I look to see if it found data or not based on the content of my "output" parm of my stored procedure. When I have data I am doing the "ASSOCIATE LOCATORS (:L0C) WITH PROCEDURE SPJUNK " and the "ALLOCATE GTT CURSOR FOR RESULT SET :LOC".
When I then try to fetch this cursor, I am getting a -504 Cursor name is not declared. Could someone please shed some light on what I am missing?
Thanks for any help you can provide. |
|
Back to top |
|
|
Robin Sulsona
New User
Joined: 14 Dec 2015 Posts: 10 Location: United States
|
|
|
|
I have found my problem. Stored Procedures are new for me so I didn't know that I needed to do the Create Procedure with a RESULT SET 1. I copied my create from the other Stored Procedure and it was RESULT SET 0. I found another person in our dept. that had done this and he gave me 2 sample programs to look at. My code was good but I decided to look at the create procedure DDL and found that he had a value other than 0.
Now everything is working like I need it to for unit testing.
Hope that this may help someone else in the future. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
Yes, it will . Thanks |
|
Back to top |
|
|
|