The DESCRIBE statement
The DESCRIBE statement obtains information about database columns or expressions in a prepared statement.
- DESCRIBE...USING SQL DESCRIPTOR stores information in a system-descriptor
area.
Each item descriptor describes a column. The COUNT field is set to the number of item descriptors (the number of columns in the column list). You can access this information with the GET DESCRIPTOR statement. For more information about the fields of a system-descriptor area, see Schematic that shows system-descriptor area for two values through Fields in each item descriptor of the system-descriptor area.
- DESCRIBE...INTO sqlda_ptr stores information in an sqlda structure
whose address is stored in sqlda_ptr.
Each sqlvar_struct structure describes a column. The sqld field is set to the number of sqlvar_struct structures (the number of columns in the column list). You can access this information through the fields in the sqlvar_struct structures. For more information about the fields of an sqlda structure, see Schematic that shows sqlda structure for two values through Descriptive fields in the sqlda structure.
- The SQLCODE value indicates the type of statement that was prepared. For more information, see Determine the statement type.
- A dynamic-management structure contains information about the
number and data types of the columns in a column list of a SELECT,
INSERT, or EXECUTE FUNCTION statement.
For information about the column descriptions returned by DESCRIBE, see Handling an unknown select list and Handling an unknown column list on Handling an unknown select list and Handling an unknown column list. For information about the data type values returned by DESCRIBE, see Determine the data type of a column.
- When the DESCRIBE statement describes a DELETE or UPDATE statement, it can indicate whether the statement includes a WHERE clause. For more information, see Check for a WHERE clause.
For more information about the DESCRIBE statement, see its entry in the HCL OneDB™ Guide to SQL: Syntax.