ASA Programming Guide
Embedded SQL Programming
The SQL descriptor area (SQLDA)
SQLDA sqllen field values
The following table indicates how you specify lengths of values when you supply data to the database server in the SQLDA.
Only the data types displayed in the table are allowed in this case. The DT_DATE, DT_TIME, and DT_TIMESTAMP types are treated the same as DT_STRING when supplying information to the database; the value must be a NULL-terminated character string in an appropriate date format.
Embedded SQL Data Type | Program action to set the length |
---|---|
DT_BIGINT | No action required |
DT_BINARY(n) | Length taken from field in BINARY structure |
DT_BIT | No action required |
DT_DATE | Length determined by terminating \0 |
DT_DECIMAL(p,s) | high byte of length field in SQLDA set to p, and low byte set to s |
DT_DOUBLE | No action required |
DT_FIXCHAR(n) | Length field in SQLDA determines length of string |
DT_FLOAT | No action required |
DT_INT | No action required |
DT_LONGBINARY | Length field ignored. See Sending LONG data |
DT_LONGVARCHAR | Length field ignored. See Sending LONG data |
DT_SMALLINT | No action required |
DT_STRING | Length determined by terminating \0 |
DT_TIME | Length determined by terminating \0 |
DT_TIMESTAMP | Length determined by terminating \0 |
DT_TIMESTAMP_STRUCT | No action required |
DT_UNSBIGINT | No action required |
DT_UNSINT | No action required |
DT_UNSSMALLINT | No action required |
DT_VARCHAR(n) | Length taken from field in VARCHAR structure |
DT_VARIABLE | Length determined by terminating \0 |