DESCRIBE
The DESCRIBE statement allows you to obtain information about parameters and other features of a prepared object before you execute it.
Format 1
EXEC SQL [ AT Database ]
 
  DESCRIBE { BIND VARIABLES  } FOR Prepared-Statement INTO { BNDDSC }
           { SELECT LIST     }                             { SELDSC }
 
END-EXEC
Format2
EXEC SQL [ AT Database ]
 
  DESCRIBE { INPUT  } Prepared-Statement INTO Sql-Descriptor
           { OUTPUT } 
 
END-EXEC
Syntax rules
Format 1
1. BNDDSC and SELDSC are group items defined in the Oracle Pro*COBOL SQLDA implementation.
2. Prepared-Statement is a Nonnumeric Literal, as defined in the Definitions section of the Preface of this document.
Format 2
1. iscobol.compiler.esql.db2 (boolean) must be set to ‘1’, ‘on’, ‘true’ or ‘yes’ in the Compiler configuration in order to compile this statement.
2. Prepared-Statement is a Nonnumeric Literal, as defined in the Definitions section of the Preface of this document.
3. Sql-Descriptor is the group item that identifies the IBM DB2 SQLDA implementation.
General rules
Format 1
1. DESCRIBE BIND VARIABLES puts descriptions of bind variables into a bind descriptor. It must follow the PREPARE statement but precede the OPEN.
2. DESCRIBE SELECT LIST puts descriptions of select-list items into a select descriptor. It must follow the OPEN statement but precede the FETCH statement.
Format 2
1. The input INPUT keyword lets you receive information about input parameters.
2. The input OUTPUT keyword lets you receive information about output parameters.
Examples
Prepare a command and get information about it in compatibility with IBM DB2
exec sql
   prepare cmd from "select c1 from tbl where c1 = ?"
end-exec.
exec sql describe input cmd into :sqlda end-exec.