Progress
Embedded SQL-92
Guide and Reference
SQLDA Structure
The complete SQLDA structure is in the
sql_lib.h
file in theinclude
directory of your installation. Here is the SQLDA structure:
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
- CHARACTER — maximum size of the array. This needs to include a space for the trailing null(0) terminator character (+1 char).
- VARCHAR — maximum size of the array. This needs to include space for the trailing null(0) terminator character (+1 char).
- TIMESTAMP — sizeof (tpe_timestamp_t)
- BINARY — sizeof (tpe_binary_t)
- VARBINARY — sizeof (tpe_binary_t)
- LONG VARBINARY — sizeof (tpe_bloblocator_t), not supportedin ESQL/C
- BIGINT — sizeof (tpe_bigint_t)
- TINYINT — 1 byte
- BIT — 1 byte (only 1 bit used)
- INTEGER — 4 bytes
- SMALLINT — 2 bytes
- NUMERIC — sizeof (tpe_num_t )
- FLOAT— double precision
- REAL — single precision
- DATE — sizeof (tpe_date_t)
- TIME — sizeof ( tpe_time_t )
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 |