CLOSE (Snowflake Scripting)

Closes the specified cursor.

For more information on cursors, see Working with Cursors.

Note

This Snowflake Scripting construct is valid only within a Snowflake Scripting block.

See also:

DECLARE, OPEN, FETCH

Syntax

CLOSE <cursor_name> ;
Copy

Where:

cursor_name

The name of the cursor.

Usage Notes

  • After a cursor is closed, the cursor’s current row pointer is invalid. Re-opening the cursor causes the cursor to start from the beginning of the new result set.

Examples

CLOSE my_cursor_name;
Copy

For a more complete example of using a cursor, see the introductory cursor example.

An example using a loop is included in the documentation on FOR loops.