Restrictions on cursor data types

Restrictions on cursor data types and cursor variables limit cursor variable functionality as well as where cursor variables can be defined and referenced.

The restrictions on cursor data types and variables are important to note before implementing them. The restrictions can be important in determining whether a cursor variable is appropriate for your needs and can be useful to review when troubleshooting errors related to cursor data type and variable use.

The following restrictions apply to cursor data types in this version:
  • Cursor data types can only be created as local types in SQL procedures.
The following restrictions apply to cursor variables in this version:
  • Cursor variables are not supported for use in applications. Cursor variables can only be declared and referenced in SQL PL contexts.
  • Cursor variables are read-only cursors.
  • Rows accessed through the use of a cursor variable are not updatable.
  • Cursor variables are not scrollable cursors.
  • Strongly typed cursor variable columns cannot be referenced as anchored data types.
  • There is no support for global cursor variables.
  • XML columns cannot be referenced in cursor variable definitions.
  • XQuery language statements cannot be used to define strongly-typed cursor result sets.