Function EXECUTE_AND_FETCH executes a parsed SELECT command and fetches one row.
Parameters
c
Cursor id of the cursor for the SELECT command to be executed.
exact
If set to TRUE, an exception is thrown if the number of rows in the result set is not exactly equal to 1. If set to FALSE, no exception is thrown. The default is FALSE. A NO_DATA_FOUND exception is thrown if exact is TRUE and there are no rows in the result set. A TOO_MANY_ROWS exception is thrown if exact is TRUE and there is more than one row in the result set.
status
Returns 1 if a row was successfully fetched, 0 if no rows to fetch. If an exception is thrown, no value is returned.
Examples
The following stored procedure uses the EXECUTE_AND_FETCH function to retrieve one employee using the employee’s name. An exception will be thrown if the employee is not found, or there is more than one employee with the same name.