DESCRIBE statement Format 2 (Receive retrieval information and I/O information)

Function

Receives into the SQL descriptor area the input ? parameter information of an SQL statement pre-processed by a PREPARE statement (data code, data length, etc.).

For details about the information to be received, see the HiRDB Version 9 UAP Development Guide. If the SQL statement pre-processed by the PREPARE statement does not have input ? parameter information, 0 is set in the SQLD area of the SQL descriptor area.

Privileges

None.

Format 2: Receiving input ? parameter information

DESCRIBE INPUT { SQL-statement-identifier | extended-statement-name} INTO
 [:]SQL-descriptor-area-name [[:]Column-Name-Descriptor-Area-name]
 [CHARACTER_SET[:]character-set-descriptor-area-name]

Operands

SQL-statement-identifier
Specifies the SQL statement identifier specified in the PREPARE statement.
extended-statement-name
Specifies the extended statement name that identifies the SQL statement preprocessed by the PREPARE statement.
For extended statement names, see 2.26 Extended statement name.
SQL-descriptor-area-name
Specifies the name of the SQL descriptor area into which input ? parameter information is to be set.
For SQL descriptor areas, see the HiRDB Version 9 UAP Development Guide.
Column-Name-Descriptor-Area-name
Specifies the Column Name Descriptor Area that is to receive the names of retrieval items or the parameter names of routines.
For Column Name 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 for input ? parameter information is to be stored.
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 must set the number of SQLVAR areas in SQLN in the SQL descriptor area.
  2. Because SQLDATA and SQLIND are both cleared when the DESCRIBE statement is executed, values must be set after the DESCRIBE statement has executed.
  3. When a Column Name Descriptor Area name is specified, the WITH SQLNAME OPTION must be specified in the corresponding PREPARE statement.
  4. Specify a Column Name Descriptor Area name only for receipt of the name of a retrieval item or a routine parameter name. A routine parameter name can be received only if a ? parameter is specified by itself in an argument of the CALL statement. If a value expression including a ? parameter is specified, the length of the Column Name Descriptor Area name will be 0.
  5. Specify a character set descriptor area only when a character set has to be specified for input ? parameter information for which the data type is character data.

Notes

  1. The SQL statement identifier, similar to an embedded variable name, is effective only within a compile-unit file. Multiple SQLs relative to the same SQL statement identifier cannot be used in multiple modules.
  2. Even if a DESCRIBE INPUT statement is not used, the same information as that obtained by using DESCRIBE INPUT can be obtained by specifying INPUT in a PREPARE statement.