Updated on 2024-05-07 GMT+08:00

DESCRIBE

Function

Retrieves metadata information for the result columns contained in prepared statements.

Syntax

DESCRIBE [ OUTPUT ] prepared_name USING  SQL  DESCRIPTOR descriptor_name
DESCRIBE [ OUTPUT ] prepared_name INTO SQL  DESCRIPTOR descriptor_name
DESCRIBE [ OUTPUT ] prepared_name INTO sqlda_name

Parameters

  • prepared_name

    Name of a prepared statement, which can be an SQL identifier or a host variable.

  • descriptor_name

    Descriptor name, which is case sensitive. It can be an SQL identifier or a host variable.

  • sqlda_name

    Name of an SQLDA variable.

Examples

EXEC SQL ALLOCATE DESCRIPTOR mydesc;
EXEC SQL PREPARE stmt1 FROM :sql_stmt;
EXEC SQL DESCRIBE stmt1 INTO SQL DESCRIPTOR mydesc;
EXEC SQL GET DESCRIPTOR mydesc VALUE 1 :charvar = NAME;
EXEC SQL DEALLOCATE DESCRIPTOR mydesc;