Previous Topic

Next Topic

Describe

Valid in: ESQL

The Describe statement retrieves information about the result of a prepared dynamic SQL statement. This statement returns the data type, length, and name of the result columns of the prepared select. If the prepared statement is not a select, describe returns a zero in the SQLDA sqld field.

Previous Topic

Next Topic

Syntax

The Describe statement has the following format:

EXEC SQL DESCRIBE statement_name INTO|USING [:]descriptor_name [USING NAMES];

The DESCRIBE statement cannot be issued until after the program allocates the SQLDA and sets the value of the SQLDA's sqln field to the number of elements in the SQLDA's sqlvar array. The results of the DESCRIBE statement are complete and valid only if the number of the result columns (from the select) is less than or equal to the number of allocated sqlvar elements. (The maximum number of result columns that can be returned is 1024.)

The PREPARE statement can also be used with the INTO clause to retrieve the same descriptive information provided by describe. For examples of the DESCRIBE statement and information about using the information it returns, see the Embedded SQL Companion Guide.

Previous Topic

Next Topic

Permissions

All users are permitted to use this statement.

Previous Topic

Next Topic

Related Statements

Describe Input

Execute

Prepare


© 2007 Ingres Corporation. All rights reserved.