View previous topic :: View next topic
|
Author |
Message |
spoorni
New User
Joined: 29 Nov 2007 Posts: 20 Location: india
|
|
|
|
I have a program where I am using a cursor. If the row is not found of the table, I still need to return the vlaue with an indicator set. For the check for end of cursor, I use the check for SQLCODE = 100. What would I use within the cursor to check for row not found on table? |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Code: |
05 WS-ROW-FLAG PIC X.
88 WS-ROW-FOUND-YES VALUE 'Y'.
88 WS-ROW-FOUND-NO VALUE 'N'.
SET WS-ROW-FOUND-NO TO TRUE.
PERFORM 1000-FETCH-CUROSR UNTIL SQLCODE = +100
1000-FETCH-CUROSR.
EXEC SQL
FETCH cursor-name
INTO :Host-Variables
END-EXEC.
EVALUATE TRUE
WHEN +00
SET WS-ROW-FOUND-YES TO TRUE
PROCESS DATA
WHEN +100
CONTINUE
WHEN OTHER
PROCESS ERROR
END-EVALUATE. |
|
|
Back to top |
|
|
|