Previous Topic Next topic Print topic


SQLDA Elements

The SQLDA consists of the four elements shown in the table below, followed by the number of SQLVAR structures specified in SQLN.

Each occurrence of SQLVAR describes a column (for DESCRIBE and PREPARE statements) or host variable (for OPEN, FETCH and EXECUTE statements), depending on the type of statement being executed. The number of SQLVAR elements appearing in the SQLDA is defined by the SQLN element of SQLDA, thus the SQLDA structure is variable length. The SQLVAR structure is shown in the following table.

COBOL Name C Name PL/I Name Data Type Usage in DESCRIBE and PREPARE INTO Usage in FETCH, OPEN or EXECUTE
SQLDAID sqldaid sqldaid char(8) The character string (SQLDA) that identifies the beginning of the SQLDA structure. Same.
SQLDABC sqlabc sqlabc integer Length of the SQLDA. Computed as SQLN*44+16. Same.
SQLN sqln sqln smallint Number of occurrences of SQLVAR. (See the SQLVAR Elementsfor more about SQLVAR.) Same.
SQLD sqld sqld smallint Number of columns described by occurrences of SQLVAR. If the statement is not a query, the value is zero. (See the SQLVAR Elementsfor more about SQLVAR.) Number of host variables described by occurrences of SQLVAR.
Previous Topic Next topic Print topic