8. OpenSQL Statements : DESCRIBE : Syntax
 
Share this page                  
Syntax
The DESCRIBE statement has the following format:
EXEC SQL DESCRIBE statement_name INTO|USING [:]descriptor_name [USING NAMES];
statement_name
Specifies a valid prepared statement. Specify the statement_name using a string literal or a host language string variable. If an error occurs when the specified statement is prepared, the statement is not valid. If a COMMIT or ROLLBACK statement is executed after the statement is prepared and before it is executed, the statement is discarded and cannot be described or executed.
descriptor name
Identifies an SQLDA. The descriptor name can be SQLDA or any other valid object name defined by the program when the structure is allocated. Because the SQLDA is not declared in a declaration section, the preprocessor does not verify that descriptor_name represents an SQLDA structure. If descriptor_name does not represent an SQLDA structure, undefined errors occur at runtime.
Descriptor_name can be preceded by a colon (:).
USING NAMES
Returns the names of result columns in the descriptor if the described statement is a SELECT statement. (The USING NAMES clause is optional and has no effect on the results of the DESCRIBE statement.)