The DESCRIBE statement

The DESCRIBE statement obtains information about database columns or expressions in a prepared statement.

The DESCRIBE statement can put this information in one of the following dynamic-management structures:
  • 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 Figure 1 through Table 1.

  • 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 Figure 1 through Table 1.

Important: If the Deferred-PREPARE feature is enabled, you cannot use the DESCRIBE statement before an OPEN statement executes. For more information, see Defer execution of the PREPARE statement.
If the DESCRIBE is successful, it obtains the following information about a prepared statement:

For more information about the DESCRIBE statement, see its entry in the HCL Informix® Guide to SQL: Syntax.


Copyright© 2019 HCL Technologies Limited