Previous Topic: SQL Descriptor AreaNext Topic: SQLLEN


SQLDA

The SQL Descriptor Area (SQLDA) is a data structure used to describe variable data passed as part of a dynamic SQL statement.

SQLDA Fields

The SQLDA consists of the following fields:

Field

Data type

Meaning

SQLDAID

CHARACTER(8)

Set to SQLDA* on a DESCRIBE

SQLN

INTEGER

Maximum number of SQLVAR occurrences

SQLD

INTEGER

Actual number of SQLVAR occurrences:

  • 0—Not a SELECT statement
  • 1 through SQLN—Number of columns
  • Greater than SQLN—Not enough SQLVAR entries

SQLVAR

 

Structure occurring SQLN times

SQLVAR Fields

The structure SQLVAR in the SQLDA consists of the following fields:

Field

Data type

Meaning

SQLLEN

INTEGER

Length

(Additional information provided under "SQLLEN")

SQLTYPE

SMALLINT

Column data type

(Additional information provided under "SQLTYPE")

SQLSCALE

SMALLINT

Scale (for exact numeric data types)

(Additional information provided under "SQLSCALE")

SQLPRECISION

SMALLINT

Precision

(Additional information provided under "SQLPRECISION")

SQLALN

SMALLINT

Data alignment flag

(Additional information provided under "SQLALN and SQLNALN ")

SQLNALN

SMALLINT

Null indicator alignment flag

(Additional information provided under "SQLALN and SQLNALN ")

SQLNULL

SMALLINT

Length of null indicator

(Additional information provided under "SQLNULL")

SQLNAME

CHARACTER(32)

Column name

Notes

The SQLDA can be used by an application program in the following ways: