DECLARE REFCURSOR
Description
A
refcursor
data type simply holds a reference to a cursor. You can create a cursor variable by declaring it as a variable of typerefcursor
Refcursor declarations are fully supported by Snowflake.
Grammar Syntax
Since Snowflake does not support the REFCURSOR
data type, its functionality is replicated by converting the REFCURSOR
variable into a RESULTSET
type. The query used to open the REFCURSOR
is assigned to the RESULTSET
variable, after which a new cursor is created and linked to the RESULTSET
variable. Additionally, all references to the original REFCURSOR
within the cursor logic are updated to use the new cursor, thereby replicating the original functionality.
Sample Source Patterns
Case: Single use
Input Code:
Output Code:
Case: Cursor with Dynamic Sql
Input Code:
Output Code:
Case: Multiple uses:
Input Code:
Output Code:
Known Issues
There are no known issues.
Related EWIs.
There are no related EWIs.
Last updated