Cursor, which is declared with the WITH RETURN attribute and which isn't closed in the procedure body, returns the result set to the client.
WITH RETURN indicates that the cursor is intended for use as a result set from a stored procedure.
DYNAMIC RESULT SETS N - Indicates the estimated upper bound of returned result sets for the stored procedure.
Within an SQL procedure, cursors, declared using the WITH RETURN clause, are still open when the SQL procedure ends, define the result sets from the SQL procedure. All other open cursors in an SQL procedure are closed when the SQL procedure ends.
The default for all cursors is WITH RETURN TO CALLER.
TO CALLER - Specifies that the cursor can return a result set to the caller. For example, if the caller is another stored procedure, the result set is returned to that stored procedure. If the caller is a client application, the result set is returned to the client application.
TO CLIENT - Specifies that the cursor can return a result set to the client application. This cursor is invisible to any intermediate nested procedures.
|