The OPEN or EXECUTE Statements

To use an SQLDA structure to specify input data to an OPEN or EXECUTE statement, your application must supply the data for the fields of the entire SQLDA structure, including the SQLN, SQLD, SQLDABC, and SQLTYPE, SQLLEN, and SQLDATA fields for each variable. The following scenarios require additional attention:

SQLTYPE field is an odd number
If the value of the SQLTYPE field is an odd number, you must also supply the address of the indicator variable using SQLIND.
Host variable input is COMP
When using OpenESQL with a host variable input defined as COMP, add 8192 (x2000) to the SQLTYPE field.
SQLTYPE field is an odd number and indicator variable is COMP
If the SQLTYPE field is an odd number, and the indicator variable is defined as a COMP, add 4096 (x1000) to the SQLTYPE field.
Host variable input is COMP-5
When using OpenESQL with a host variable input defined as COMP-5, no change to the SQLTYPE field is required.

For a list of all SQLTYPE values supported by OpenESQL, see The SQLDA Data Structure.