ASA Programming Guide
Embedded SQL Programming
The SQL descriptor area (SQLDA)
SQLDA sqllen field values
The following table indicates the values of the length field when you retrieve data from the database using a SQLDA. The sqllen field is never modified when you retrieve data.
Only the interface data types displayed in the table are allowed in this case. The DT_DATE, DT_TIME, and DT_TIMESTAMP data types are treated the same as DT_STRING when you retrieve information from the database. The value is formatted as a character string in the current date format.
Embedded SQL Data Type | What the program must set length field to when receiving | How the database returns length information after fetching a value |
---|---|---|
DT_BIGINT | No action required | No action required |
DT_BINARY(n) | Maximum length of BINARY structure (n+2) | len field of BINARY structure set to actual length |
DT_BIT | No action required | No action required |
DT_DATE | Length of buffer | \0 at end of string |
DT_DECIMAL(p,s) | High byte set to p and low byte set to s | No action required |
DT_DOUBLE | No action required | No action required |
DT_FIXCHAR(n) | Length of buffer | Padded with blanks to length of buffer |
DT_FLOAT | No action required | No action required |
DT_INT | No action required | No action required |
DT_LONGBINARY | Length field ignored. See Retrieving LONG data | Length field ignored. See Retrieving LONG data |
DT_LONGVARCHAR | Length field ignored. See Retrieving LONG data | Length field ignored. See Retrieving LONG data |
DT_SMALLINT | No action required | No action required |
DT_STRING | Length of buffer | \0 at end of string |
DT_TIME | Length of buffer | \0 at end of string |
DT_TIMESTAMP | Length of buffer | \0 at end of string |
DT_TIMESTAMP_ STRUCT | No action required | No action required |
DT_UNSBIGINT | No action required | No action required |
DT_UNSINT | No action required | No action required |
DT_UNSSMALLINT | No action required | No action required |
DT_VARCHAR(n) | Maximum length of VARCHAR structure (n+2) | len field of VARCHAR structure set to actual length |