2.27 Extended cursor name

Organization of this section
(1) Overview
(2) Format
(3) Explanation
(4) Rules

(1) Overview

The extended cursor name, when specified in an ALLOCATE CURSOR statement, identifies the cursor that is allocated to a group of result sets that are returned by a dynamic SELECT statement or a procedure. When specified in one of the following SQL statements, the extended cursor name permits operations on the cursor identified by it:

In addition, when directly specified in any of the following SQL statements, the value of an extended cursor name permits operations on the cursor identified by the extended cursor name:

(2) Format

extended-cursor-name :: = scope-option : embedded-variable
scope-option :: = GLOBAL

(3) Explanation

(4) Rules

  1. Values must be specified in embedded-variable according to the specification method applicable to cursor names. For details about cursor name specification methods, see 1.1.7 Specification of names.
  2. Extended cursor names having the same value are identified as the same extended cursor name.
  3. An error may result if an extended cursor name is specified in an ALLOCATE CURSOR statement and if another valid extended cursor name having the same name already identifies another cursor.
  4. If the value of an extended cursor name is the same as the cursor name that is directly specified in an SQL statement, both are distinguished as identifying different cursors, with the exception that a cursor name directly specified in a preparable-dynamic UPDATE-statement-locating or preparable-dynamic DELETE-statement-locating identifies the cursor that is the same as the extended cursor name having that value.