CURSOR
Description
CURSOR cursor
[ ( cursor_parameter_dec [, cursor_parameter_dec ]... )]
[ RETURN rowtype] IS select_statement ;OPEN cursor [ ( cursor_parameter [ [,] actual_cursor_parameter ]... ) ] ;FETCH { cursor | cursor_variable | :host_cursor_variable }
{ into_clause | bulk_collect_into_clause [ LIMIT numeric_expression ] } ;CLOSE { cursor | cursor_variable | :host_cursor_variable } ;named_cursor%{ ISOPEN | FOUND | NOTFOUND | ROWCOUNT }[ FOR record IN
{ cursor [ ( cursor_parameter_dec
[ [,] cursor_parameter_dec ]... )]
| ( select_statement )
}
LOOP statement... END LOOP [label] ;Sample Source Patterns
1. Basic cursor example
2. Explicit Cursor For Loop
3. Implicit Cursor For Loop
4. Parameterized Cursor
4.1 Basic Cursor Parameterized Example
4.2 Parameterized Cursors With Multiple Sending Parameters
4.3 Parameterized Cursors With Use Of Procedure Parameters In Query
5. Using Cursors In Fetch And For Loop
5.1 Cursors For Loop
5.2 Cursors Fetch
Known Issues
1. RETURN clause is not supported in Snowflake Scripting Cursor Declaration
2. OPEN statement cannot pass values for declared arguments
3. FETCH statement cannot use records
4. FETCH BULK COLLECT INTO clause is not supported in Snowflake Scripting
5. Cursor attributes do not exist in Snowflake Scripting
6. The cursor's query does not have access to the procedure's variables and parameters
7. %NOTFOUND attribute is not supported in Snowflake Scripting Cursor
Related EWIs
Last updated
