C* Declare cursor
C/EXEC SQL
C+ DECLARE C1 CURSOR FOR
C+ SELECT DESIRED_FIELDS
C+ FROM MY_FILE
C+ WHERE CONDITION_1 AND CONDITION_2
C+ ORDER BY SOME_FIELD
C/ END-EXEC
:
:
C* Open the cursor
C/EXEC SQL
C+ OPEN C1
C/END-EXEC
:
:
C SQLCOD DOWEQ *ZEROS
:
:
C* Fetch the data.
C/EXEC SQL
C+ FETCH FROM C1
C+ INTO
C+ DESIRED_FIELDS
C/END-EXEC
:
:
C IF SQLCOD <> *ZEROS
C LEAVE
C ENDIF
C EXSR PROCESS_SQL_DATA
C ENDDO
C* Close the Cursor
C/EXEC SQL
C+ CLOSE C1
C/END-EXEC
At above IF I am getting error with error code: SQLCOD = -000000303
and then I am leaving the loop.
Here is my job log:
ODP created.
Blocking used for query.
Cursor C1 opened.
Host variable VARIABLE1 not compatible.
SQLCOD = -000000303.
I am having valid data to satisfy my above conditions in my_file.
It is working fine in Interfactive SQL. I am not able to understand what
could go wrong.... Any help would be greatly appreciated.
C/EXEC SQL
C+ DECLARE C1 CURSOR FOR
C+ SELECT DESIRED_FIELDS
C+ FROM MY_FILE
C+ WHERE CONDITION_1 AND CONDITION_2
C+ ORDER BY SOME_FIELD
C/ END-EXEC
:
:
C* Open the cursor
C/EXEC SQL
C+ OPEN C1
C/END-EXEC
:
:
C SQLCOD DOWEQ *ZEROS
:
:
C* Fetch the data.
C/EXEC SQL
C+ FETCH FROM C1
C+ INTO
C+ DESIRED_FIELDS
C/END-EXEC
:
:
C IF SQLCOD <> *ZEROS
C LEAVE
C ENDIF
C EXSR PROCESS_SQL_DATA
C ENDDO
C* Close the Cursor
C/EXEC SQL
C+ CLOSE C1
C/END-EXEC
At above IF I am getting error with error code: SQLCOD = -000000303
and then I am leaving the loop.
Here is my job log:
ODP created.
Blocking used for query.
Cursor C1 opened.
Host variable VARIABLE1 not compatible.
SQLCOD = -000000303.
I am having valid data to satisfy my above conditions in my_file.
It is working fine in Interfactive SQL. I am not able to understand what
could go wrong.... Any help would be greatly appreciated.





Comment