%FOUND v17
The %FOUND
attribute tests whether a row is retrieved from the result set of the specified cursor after a FETCH
on the cursor.
cursor_name
is the name of the cursor for which a BOOLEAN
data type of TRUE
is returned if a row is retrieved from the result set of the cursor after a FETCH
.
After the last row of the result set is fetched, the next FETCH
results in %FOUND
returning FALSE
. FALSE
is also returned after the first FETCH
if the result set has no rows to begin with.
Referencing %FOUND
on a cursor before it's opened or after it's closed results in an INVALID_CURSOR
exception.
%FOUND
returns null
if it's referenced when the cursor is open but before the first FETCH
.
This example uses %FOUND
:
The following is the output from this example: