About SQLDAs

SQLDA is a host-language structure that, like an SQL descriptor, describes the variables used in a dynamic SQL prepared statement. Unlike SQL descriptors, SQLDAs are public data structures whose fields you can access. Statements using SQLDAs may execute faster than equivalent statements using SQL descriptors.

The SQLDA structure is not part of the SQL standard. Different implementations of Embedded SQL define the SQLDA structure differently. Embedded SQL version 11.1 and later supports the SQLDA defined by Sybase; it does not support SQLDA datatypes defined by other vendors.

Embedded SQL does not limit the number of SQLDA structures that can be created by a program.

Table 7-1 describes the fields of the SQLDA structure.

Table 7-1: Fields of the SQLDA structure

Field

Datatype

Description

SD-SQLN

PIC S9(9) COMP

The size of the sd_column array.

SD-SQLD

PIC S9(9) COMP

The number of columns in the query being described, or 0 if the statement being described is not a query. For fetch, open, and execute statements, this field indicates the number of host variables described by occurrences of sd_column or the number of dynamic parameter markers for the describe input statement.

SD-DATAFMT OF SD-COLUMN

Data format structure

The Client-Library CS_DATAFMT structure associated with this column. Refer to descriptions of ct_bind, ct_param and ct_describe in the Open Client Client-Library/C Reference Manual for more information.

SD-SQLDATA OF SD-COLUMN

PIC S9(9) COMP

or

PIC S9(18) COMP

For fetch, open, and execute statements, stores the address of the statement’s host variable. This field is not used for describe or prepare statements.

SD-SQLIND OF SD-COLUMN

PIC S9(4) COMP

For fetch, open, and execute statements, this field acts as an indicator variable for the column being described. If the column’s value is null, this field is set to -1. This field is not used for describe or prepare statements. Set this field using SYBSETSQLDA (see “Using SYBSETSQLDA”).

SD-SQLLEN OF SD-COLUMN

PIC S9(9) COMP

The actual size of the Client Library CS_DATAFMT structure associated with this column.

SD-SQLMORE OF SD-COLUMN

PIC S9(9) COMP

or

PIC S9(18) COMP

Reserved.