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 or time of day 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 null character. |
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. |
DT_LONGNVARCHAR | Length field ignored. |
DT_LONGVARCHAR | Length field ignored. |
DT_NFIXCHAR(n) | Length field in SQLDA determines length of string. |
DT_NSTRING | Length determined by terminating \0. If the ansi_blanks option is On and the database is blank-padded, then the length field in the SQLDA must be set to the length of the buffer containing the value (at least the length of the value plus space for the terminating null character). |
DT_NVARCHAR | Length taken from field in NVARCHAR structure. |
DT_SMALLINT | No action required. |
DT_STRING | Length determined by terminating \0. If the ansi_blanks option is On and the database is blank-padded, then the length field in the SQLDA must be set to the length of the buffer containing the value (at least the length of the value plus space for the terminating null character). |
DT_TIME | Length determined by terminating null character. |
DT_TIMESTAMP | Length determined by terminating null character. |
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. |