SQLDA sqllen Field Values when Retrieving Data

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). The maximum value for n is 32765. len field of BINARY structure set to actual length in bytes.
DT_BIT No action required. No action required.
DT_DATE Length of buffer. null character at end of string.
DT_DOUBLE No action required. No action required.
DT_FIXCHAR(n) Length of buffer, in bytes. The maximum value for n is 32767. 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. Length field ignored.
DT_LONGNVARCHAR Length field ignored. Length field ignored.
DT_LONGVARCHAR Length field ignored. Length field ignored.
DT_NFIXCHAR(n) Length of buffer, in bytes. The maximum value for n is 32767. Padded with blanks to length of buffer.
DT_NSTRING Length of buffer. null character at end of string.
DT_NVARCHAR(n) Maximum length of NVARCHAR structure (n+2). The maximum value for n is 32765. len field of NVARCHAR structure set to actual length in bytes of string.
DT_SMALLINT No action required. No action required.
DT_STRING Length of buffer. null character at end of string.
DT_TIME Length of buffer. null character at end of string.
DT_TIMESTAMP Length of buffer. null character 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). The maximum value for n is 32765. len field of VARCHAR structure set to actual length in bytes of string.