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. The embedded SQL type is obtained by a bitwise AND of sqltype with DT_TYPES (sqltype & DT_TYPES).
For information on embedded SQL data types, see Embedded SQL data types.
|Database field type||Embedded SQL type returned||Length returned on describe|
|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|
|NCHAR(n)||DT_NFIXCHAR1||n times maximum character length in client's NCHAR character set|
|NVARCHAR(n)||DT_NVARCHAR1||n times maximum character length in client's NCHAR character set|
|TIME||DT_TIME||length of longest formatted string|
|TIMESTAMP||DT_TIMESTAMP||length of longest formatted string|
1 In embedded SQL, NCHAR, NVARCHAR, and LONG NVARCHAR are described as either DT_FIXCHAR, DT_VARCHAR, and DT_LONGVARCHAR, respectively, by default. If the db_change_nchar_charset function has been called, the types are described as DT_NFIXCHAR, DT_NVARCHAR, and DT_LONGNVARCHAR, respectively. See db_change_nchar_charset function.