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 manual HiRDB Version 8 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]

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 8 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 8 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 should be set after the DESCRIBE statement has executed.
  3. When a Column Name Descriptor Area name is specified, the WITH SQLNAME OPTION should be specified in the corresponding PREPARE statement.
  4. A Column Name Descriptor Area name should be specified 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.

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.