%FOUND v13
The %FOUND
attribute is used to test whether or not 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
will be returned if a row is retrieved from the result set of the cursor after a FETCH
.
After the last row of the result set has been fetched the next FETCH
results in %FOUND
returning FALSE
. FALSE
is also returned after the first FETCH
if there are no rows in the result set to begin with.
Referencing %FOUND
on a cursor before it is opened or after it is closed results in an INVALID_CURSOR
exception being thrown.
%FOUND
returns null
if it is referenced when the cursor is open, but before the first FETCH
.
The following example uses %FOUND
.
When the previous procedure is invoked, the output appears as follows: