Progress
Embedded SQL-92
Guide and Reference


SQLDA Structure

The complete SQLDA structure is in the sql_lib.h file in the include directory of your installation. Here is the SQLDA structure:

struct sqlda { 
   
  dh_i32_t 
sqld_size; 
/* da, DEPRECATED, max # cols in 
da */ 
  dh_i32_t 
sqld_nvars; 
/* da, DEPRECATED, actual/desired 
# cols */ 
  void 
**sqld_varptrs; 
/* col, ptr to data buffer */ 
  dh_u32_t 
*sqld_lengths; 
/* col, size (bytes) of data in 
col as bin (+1 char if char data) 
*/ 
  dh_i32_t 
*sqld_types; 
/* col, data type */ 
  dh_u32_t 
*sqld_precision; 
/* col, size (chars) of data in 
col as char */ 
  dh_i16_t 
*sqld_scale; 
/* col, decimal digits to right of 
DP */ 
  dh_u32_t 
*sqld_flags; 
/* col, allows nulls */ 
  dh_i32_t 
**sqld_ivarptrs; 
/* col, ptr to indicator data (sz, 
null) */ 
  dh_i16_t 
sqld_varnmsize; 
/* da, max size (bytes) data col 
name */ 
  dh_i16_t 
sqld_indvarnmsz; 
/* da, DEPRECATED, max size 
(bytes) data indicator name */ 
  dh_char_t 
**sqld_varnames; 
/* col, ptr to user’s data col 
name */ 
  dh_char_t 
**sqld_indvarnames; 
/* col, ptr to user’s indicator 
name */ 
  dh_u32_t 
sqld_arraysz; 
/* da, # rows in multi-row 
operation */ 
  dh_u32_t 
sqld_clengths; 
/* col, actual data size in chars 
*/ 
  dh_u32_t 
*sqld_returned_lengths; 
/* col, Dictionary size of col */ 
  dh_u32_t 
*sqld_odbc_flags; 
/* col, ODBC flags: AUTO, sIGN, 
UNNAMED, etc */ 
  dh_i16_t 
*sqld_date_int_code; 
/* col, DEPRECATED, internal date 
code */ 
  dh_i16_t 
*sqld_date_int_prec; 
/* col, DEPRECATED, # seconds 
digits to right of DP*/ 
  dh_char_t 
**sqld_collat_name; 
/* col, collation sequence name */ 
  dh_char_t 
**sqld_charset_name; 
/* col, charset name */ 
  dh_i32_t 
sqld_max_size; 
/* da, DEPRECATED, max # cols in 
da */ 
  dh_char_t 
**sqld_base_column_name; 
/* col, base column name */ 
  dh_char_t 
**sqld_base_table_name; 
/* col, base table name */ 
  dh_i16_t 
*sqld_searchable; 
/* col, col is searchable (WHERE 
clause) */ 
  dh_i16_t 
*sqld_updatable; 
/* col, col is updatable (INSERT, 
UPDATE, etc.) */ 
  dh_i16_t 
*sqld_param_type; 
/* col, param is IN, OUT, or 
INTOUT */ 
  dh_char_t 
**sqld_table_name; 
/* col, table name */ 
  dh_i16_t 
*sqld_verbose_types; 
/* col, DEPRECATED, MS SQL 
Extension for dates */ 
  dh_u32_t 
sqld_v0; 
/* opaque */ 
  dh_u32_t 
sqld_v1; 
/* opaque */ 
  dh_u32_t 
sqld_v2; 
/* opaque */ 
  dh_u32_t 
sqld_v3; 
/* opaque */ 
  dh_u32_t 
sqld_v7; 
/* opaque */ 
  dh_u32_t 
sqld_v8; 
/* opaque */ 

Descriptions of the fields in the SQLDA follow:

SQLD_SIZE

Maximum number of variables (columns) that this SQLDA object can handle.

SQLD_NVARS

Number of variables (columns) found by a DESCRIBE operation. If you do not do a DESCRIBE operation, you will need to fill this in yourself.

SQLD_VARPTRS

Array of pointers to host variable names. The application sets elements of this array to point to the allocated buffer for storing the values retrieved in a FETCH operation. The buffer that array element SQLD_VARPTRS [ i ] points to must be of size ( SQLD_LENGTHS [ i ] * SQLD_ARRAYSZ ).

SQLD_LENGTHS

SQLD_TYPES

Array of data types buffers.

SQLD_PRECISION

Array of precision values. These are the widths needed to display the data in characters without any special formatting. For example, an INTEGER has a PRECISION of 10. If the data is character, it does not include the trailing null(0) terminator character.

SQLD_SCALE

Array of scale values. These are the number of digits to the right of the decimal point for numeric data. It also applies to TIME and TIMESTAMP data where it is the number of fractional seconds.

SQLD_FLAGS

Array of boolean attributes. It indicates whether or not a variable or column can contain NULL values.

SQLD_IVARPTRS

Array of pointers to indicator variables. The application is responsible for assigning values in the array of pointers. If you do not wish to use indicator variables, you do not have to assign any values. If you do not assign values and they are needed by the server, an error will be generated. The indicator variable buffer that array element
SQLD_IVARPTRS [ i ] points to must be of (sizeof (dh_i32_t) * SQLD_ARRAYSZ ).

The value pointed to can take on three types of values. A -1 means that the particular value is NULL. A 0 (zero) menas that the value is good, ordinary data. A positive value indicates that your SQLD_LENGTHS value is not large enough to hold the result. In this case, the positive value is the size that was needed.

SQLD_VARNMSIZE

Maximum size of variable names.

SQLD_INDVARNMSZ

This attribute is unused and will be removed in a future release.

SQLD_VARNAMES

Array pointers to host variable names.

SQLD_INDVARNAMES

This attribute is unused and will be removed in a future release.

SQLD_ARRAYSZ

Size of an array the application allocates. Before fetching multiple rows in a single execution of a FETCH statement, the application sets this value to the number of rows to be fetched. Use this value in the computation of the size of storage arrays the application must allocate to store fetched values and to hold indicator variables.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095