SQL/MX 2.x Reference Manual (H06.04+)

Embedded-Only SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
3-33
DESCRIBE Statement
DESCRIBE Statement
C Examples of DESCRIBE
COBOL Examples of DESCRIBE
The DESCRIBE statement obtains information, including data types of columns, about
dynamic input and output parameters contained in a prepared statement. A parameter
is a placeholder for a value to be supplied when the statement executes.
There are two forms of the DESCRIBE statement:
DESCRIBE INPUT—initializes the input SQL descriptor area based on the input
parameters for a prepared statement
DESCRIBE [OUTPUT]—stores descriptions into the SQL descriptor area of output
parameters (usually SELECT columns) from a prepared statement
Use DESCRIBE only in embedded SQL programs in C or COBOL.
statement-name
is an SQL identifier—the name of a prepared statement. The module that contains
DESCRIBE must also contain a PREPARE statement for statement-name. See
Identifiers on page 6-52.
ext-statement-name
is a value-specification—a host variable with character data type. When
DESCRIBE executes, the content of the value specification must identify a
statement previously prepared within the scope of DESCRIBE.
DESCRIBE {INPUT | [OUTPUT]} SQL-stmt-name using-descriptor
SQL-stmt-name is:
statement-name | ext-statement-name
ext-statement-name is:
[GLOBAL | LOCAL] value-specification
using-descriptor is:
USING SQL DESCRIPTOR descriptor-name
descriptor-name is:
[GLOBAL | LOCAL] value-specification
C/COBOL