skip to main content
Designing and coding the IP : Bulk insert : Mapping SQL datatypes to C datatypes
 

Mapping SQL datatypes to C datatypes

The following table shows the corresponding C/C++ datatypes that dam_getBulkValueToSet returns for the SQL datatypes while using C/C++.
 
Table 15: Mapping SQL datatypes to C datatypes
SQL datatypes
C datatypes
XO_TYPE_CHAR
A null terminated string
XO_TYPE_VARCHAR
A null terminated string
XO_TYPE_WCHAR
A null terminated Unicode string in UTF-16 encoding
XO_TYPE_WVARCHAR
A null terminated Unicode string in UTF-16 encoding
XO_TYPE_NUMERIC
A null terminated string
XO_TYPE_DECIMAL
A null terminated string
XO_TYPE_BIGINT
A null terminated string
XO_TYPE_INTEGER
SIGNED INT
XO_TYPE_SMALLINT
SIGNED SHORT INT
XO_TYPE_TINYINT
CHAR of length 1 byte
XO_TYPE_BIT
CHAR of length 1 byte
XO_TYPE_REAL
A single precision floating point number
XO_TYPE_DOUBLE
A double precision floating point number
XO_TYPE_FLOAT
A double precision floating point number
XO_TYPE_DATE
A null terminated string of the format yyyy-mm-dd
XO_TYPE_TIME
A null terminated string of the format hh-mm-ss
XO_TYPE_TIMESTAMP
A null terminated string of the format yyyy-mm-dd HH:mm:ss.ffffff
XO_TYPE_BINARY
A binary stream of fixed length
XO_TYPE_VARBINARY
A binary stream of variable length