DESCRIBE CURSOR statement (Receive cursor retrieval information)

Function

Receives cursor query retrieval item information for referencing the result set returned from a procedure into the SQL descriptor area (data code, data length, etc.).

For details about the information to be received, see the HiRDB Version 9 UAP Development Guide.

Privileges

None.

Format 1: Receiving cursor retrieval item information

DESCRIBE [OUTPUT] CURSOR extended-cursor-name STRUCTURE  INTO
      [:] SQL-descriptor-area[CHARACTER_SET[:]character-set-descriptor-area-name]

Operands

For operands other than the CURSOR extended-cursor-name STRUCTURE operand, see DESCRIBE statement Format 1.

extended-cursor-name
Specifies the name of the extended cursor that identifies the cursor allocated to the group of result sets that was returned by a procedure in ALLOCATE CURSOR statement Format 2.
For extended cursor names, see 2.27 Extended cursor name.
SQL-descriptor-area-name
Specifies the name of the SQL descriptor area into which cursor retrieval item information is to be stored.
For SQL descriptor areas, see the HiRDB Version 9 UAP Development Guide.
character-set-descriptor-area-name
Specifies a character set descriptor area into which a character set name is to be stored for cursor retrieval item information.
For details about character set descriptor areas, see the HiRDB Version 9 UAP Development Guide.

Common rules

  1. Before executing the DESCRIBE statement, the UAP should assign the number of SQLVAR (SQLN areas) in the SQL descriptor area.
  2. Because the SQLDATA and SQLIND are cleared when the DESCRIBE statement is executed, if the DESCRIBE statement is used, a value should be assigned after the statement is executed.

Example

  1. Assign retrieval item information on the cursor (extended cursor name: cr, scope: GLOBAL) allocated to the group of result sets returned by the procedure PROC1 to SQL-descriptor-area.

CALL PROC1()
ALLOCATE GLOBAL :cr FOR PROCEDURE PROC1
DESCRIBE CURSOR GLOBAL :cr STRUCTURE INTO :SQLDA