Returning a REF CURSOR from a function v14
This example opens the cursor variable with a query that selects employees with a given job. The cursor variable is specified in this function’s RETURN
statement, which makes the result set available to the caller of the function.
This function is invoked in the following anonymous block by assigning the function’s return value to a cursor variable declared in the anonymous block’s declaration section. The result set is fetched using this cursor variable, and then it is closed.
The following is the output when the anonymous block is executed: