DB2 Version 9.7 for Linux, UNIX, and Windows

SYS_REFCURSOR cursor variables (PL/SQL)

The DB2® server supports the declaration of cursor variables of the SYS_REFCURSOR built-in data type, which can be associated with any result set.

The SYS_REFCURSOR data type is known as a weakly-typed REF CURSOR type. Strongly-typed cursor variables of the REF CURSOR type require a result set specification.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-DECLARE--cursor-variable-name--SYS_REFCURSOR----------------><

Description

cursor-variable-name
Specifies an identifier for the cursor variable.
SYS_REFCURSOR
Specifies that the data type of the cursor variable is the system-defined SYS_REFCURSOR data type.

Example

The following example shows a SYS_REFCURSOR variable declaration:
DECLARE emprefcur SYS_REFCURSOR;