Embedded SQL for C (ESQL/C) maps C data types to Microsoft® SQL Server™ 2000 data types, and vice versa. No Unicode data types are supported in ESQL/C (for example, the data types nvarchar, nchar, and ntext are not supported). Conversions are supported for all non-Unicode data types except datetime or smalldatetime, money or smallmoney, and, in some instances, decimal or numeric. Data types that can be converted to datetime or smalldatetime, money or smallmoney, and decimal or numeric are indicated by T.
|C data type||Assigned SQL Server data type||datetime or smalldatetime||money or smallmoney||decimal or numeric|
|void *p||binary (2)||T||T||T|
The above table is valid for SQL Server version 6.5. In SQL Server 7.0, mapping from one type to another is done by the database server. So all the above conversions are true in SQL Server 7.0.
Output data is truncated if the receiving data type is too short. This causes an exception (warning), and the SQLCODE field of the SQLCA data structure is set to +1. Input data can be truncated if the receiving SQL Server column is too short. However, in this case, no exception is generated.
Because text data types are not allowed in stored procedures, you cannot use C fields that are more than 255 bytes long in static SQL statements compiled into access plans.