You should only do the declare once and only once. Take it out of this subroutine, and put it in your program initialization routine, or somewhere where it is only executed once. Remember, the SQL query is executed, and result set generated, on the OPEN statement, not the DECLARE statement. People tend to forget this - I do, from time to time.
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
SQLRPG Cursor not open error.
Collapse
X
-
SQLRPG Cursor not open error.
Help! I'm Living in FORUMS and I Can't Get Out. This program is writing data to a screen. Information can be displayed for a case or a pallet. I can retrieve pallet information using a pallet number from a case file. This is the 1st exsr and works for repeated case selections. In the 2nd exsr, I'm contstruct key24. Key24 contains valid data. When I call my subroutine, I don't get past my declare statement. I get a cursor not open error. Doesn't matter if the 1st selection I make on entering the program is the pallet or not. How can I have an open error on one and not the other? Missing line numbers in the code are comment lines.
Code
Comment