ASA Programming Guide
Embedded SQL Programming
The SQL descriptor area (SQLDA)
SQLDA sqllen field values
The following table indicates the values of the sqllen and sqltype structure members returned by the DESCRIBE command for the various database types (both SELECT LIST and BIND VARIABLE DESCRIBE statements). In the case of a user-defined database data type, the base type is described.
Your program can use the types and lengths returned from a DESCRIBE, or you may use another type. The database server performs type conversions between any two types. The memory pointed to by the sqldata field must correspond to the sqltype and sqllen fields.
For information on embedded SQL data types, see Embedded SQL data types.
Database field type | Embedded SQL type returned | Length returned on describe |
---|---|---|
BIGINT | DT_BIGINT | 8 |
BINARY(n) | DT_BINARY | n |
BIT | DT_BIT | 1 |
CHAR(n) | DT_FIXCHAR | n |
DATE | DT_DATE | length of longest formatted string |
DECIMAL(p,s) | DT_DECIMAL | high byte of length field in SQLDA set to p, and low byte set to s |
DOUBLE | DT_DOUBLE | 8 |
FLOAT | DT_FLOAT | 4 |
INT | DT_INT | 4 |
LONG BINARY | DT_LONGBINARY | 32767 |
LONG VARCHAR | DT_LONGVARCHAR | 32767 |
REAL | DT_FLOAT | 4 |
SMALLINT | DT_SMALLINT | 2 |
TIME | DT_TIME | length of longest formatted string |
TIMESTAMP | DT_TIMESTAMP | length of longest formatted string |
TINYINT | DT_TINYINT | 1 |
UNSIGNED BIGINT | DT_UNSBIGINT | 8 |
UNSIGNED INT | DT_UNSINT | 4 |
UNSIGNED SMALLINT | DT_UNSSMALLINT | 2 |
VARCHAR(n) | DT_VARCHAR | n |