|
6992 C* 4. If there were no errors then declare the cursor...
6992 C*
6992 C SQLCOD IFEQ *ZEROS
6992 C*
6992 C/Exec SQL
6992 C+ Declare csrSQL cursor for prpSQL
6992 C/End-Exec
6992 C*
I'm having to modify an old, old, old RPG 400 program and need to embed
some SQL into it, however after making my changes the SQL pre-compiler
throws out an error saying that the cursor needs to be defined first.
The section of code that prepares, declares and opens the cursor looks
like this:
<snip>
6992 C/Exec SQL
6992 C+ Prepare prpSQL from :wSQL
6992 C/End-Exec
6992 C*
6992 C* 4. If there were no errors then declare the cursor...
6992 C*
6992 C SQLCOD IFEQ *ZEROS
6992 C*
6992 C/Exec SQL
6992 C+ Declare csrSQL cursor for prpSQL
6992 C/End-Exec
6992 C*
6992 C* 5. If there were no errors then open the cursor...
6992 C*
6992 C SQLCOD IFEQ *ZEROS
6992 C*
6992 C/Exec SQL
6992 C+ Open csrSQL
6992 C/End-Exec
6992 C ENDIF
</snip>
However, the pre-compiler report shows the following errors:
Record *...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+...
258 6992 C+ Close csrSQL
780 6992 C+ Open csrSQL
796 6992 C+ Fetch csrSQL into :wRRNA, :wRRNB, :wTYPE
5722ST1 V5R4M0 060210 Create SQL RPG Program
DIAGNOSTIC MESSAGES
MSG ID SEV RECORD TEXT
SQL0504 35 258 Position 16 Cursor CSRSQL not declared.
SQL0504 35 780 Position 15 Cursor CSRSQL not declared.
SQL0504 35 796 Position 16 Cursor CSRSQL 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.