Supported Conversions

Before the consumer creates an accessor, it can call IConvertType::CanConvert to determine if the provider supports a particular conversion.

Default Data Type Mapping

The OpenLink Provider binds to the ODBC/UDBC data source using the types in the table below. The SQL type is queried using SQLDescribeCol. The sign of the data type (signed/unsigned) is determined using SQLColAttributes. It is used in deciding which C type to use in internal buffers and which type indicator to return through IColumnsInfo::GetColumnInfo.


Table: 5.7.9.1.1. OLE-DB Data Type Mappings


SQL Type Indicator Indicator of C Type Used For Internal Buffers OLE DB Type Indicator
SQL_CHAR, SQL_VARCHAR, SQL_LONGVARCHAR, SQL_DECIMAL, SQL_NUMERIC SQL_C_CHARDBTYPE_STR
SQL_BITSQL_C_BITDBTYPE_BOOL
SQL_TINYINT, SQL_SMALLINTSQL_C_USHORT, SQL_C_SSHORTSDBTYPE_I2
SQL_INTEGERSQL_C_ULONG, SQL_C_SLONGDBTYPE_I4
SQL_BIGINTSQL_C_STRDBTYPE_STR
SQL_REALSQL_C_FLOATDBTYPE_R4
SQL_FLOAT, SQL_DOUBLESQL_C_DOUBLEDBTYPE_R8
SQL_BINARY, SQL_VARBINARY, SQL_LONGVARBINARYSQL_C_BINARYDBTYPE_BYTES
SQL_DATESQL_C_DATEDBTYPE_DATE
SQL_TIMESQL_C_TIMEDBTYPE_DATE
SQL_TIMESTAMPSQL_C_TIMESTAMPDBTYPE_DATE


Length Binding

For types DBTYPE_UI1, DBTYPE_I2, DBTYPE_I4, DBTYPE_I8, DBTYPE_R4, DBTYPE_R8, DBTYPE_CY, DBTYPE_NUMERIC, the length binding is always set to the fixed size of the destination binding type, rather than the internal source type.

Supported Data Conversions

The follwoing table outlines the supported type conversion implemented in the OpenLink provider. An 'X' means supported, and '-' means not supported.

Table: 5.7.9.3.1. OLE-DB Data Type Conversions

I1 I2 I4 I8 UI1 UI2 UI4 UI8 R4 R8 CY DEC NUM BOOL DATE DBDATE DBTIMESTAMP DBTIME BYTES BSTR STR WSTR DISP UNK GUID
I1XXXXXXXXXXXXX-----XXXX---
I2XXXXXXXXXXXXX-----XXXX---
I4XXXXXXXXXXXXX-----XXXX---
I8XXXXXXXXXXXXX-----XXXX---
UI1XXXXX XXXXXXXX-----XXXX---
UI2XXXXXXXXXXXXX-----XXXX---
UI4XXXXXXXXXXXXX-----XXXX---
UI8XXXXXXXXXXXXX-----XXXX---
R4XXXXX XXXXXXXX-----XXXX---
R8XXX XXXXXXXXXX-----XXXX---
CYXXXXXXXXXXXXX-----XXXX---
DECXXXXX XXXXXXXX-----XXXX---
NUMXXXXXXXXXXXXX-----XXXX---
BOOL-------------X----XXXX---
DATE--------------XXXX XXXX---
DBDATE--------------XX-XXXXX---
DBTIME--------------X-XXXXXX---
DBTIMESTAMP--------------XXXXXXXX---
BYTESXXXXXXXXXXXXXXXX-XXXXXXXX
BSTRXXXXXXXX XXXXXXXXXXXXXX--X
STRXXXXXXXXXXXXXXXXXXXXXX-XX
WSTRXXXXXXXXXXXXXXXXXXXXXX-XX
DISP------------------X---XX-
UNK------------------X----X-
GUID------------------XXXX--X