Datatype mapping

The following table describes the ASE OLE DB Provider datatype mappings.

Table 1-2: Datatype mappings

ASE datatype

OLE DBTYPE

C++ datatype

binary

DBTYPE_BYTES

unsigned char[]

bit

DBTYPE_BOOL

BOOL

char

DBTYPE_STR, DBTYPE_BSTR

char[], BSTR

date

DBTYPE_DBDATE

DATE_STRUCT

datetime

DBTYPE_DBTIMESTAMP

TIMESTAMP_STRUCT

decimal

DBTYPE_DECIMAL

SQL_NUMERIC

double

DBTYPE_R8

double

float(<16)

DBTYPE_R4

float

float(>=16)

DBTYPE_R8

double

image

DBTYPE_IUNKNOWN, DBTYPE_BYTES

IUnknown, unsigned char[]

NoteSybase recommends you use streams through IUnknown interfaces, but it can also be bound as unsigned char[].

int[eger]

DBTYPE_I4

long

money

DBTYPE_CY

long long

nchar

DBTYPE_STR, DBTYPE_BSTR

char[], BSTR�

numeric

DBTYPE_NUMERIC

SQL_NUMERIC�

nvarchar

DBTYPE_STR, DBTYPE_BSTR

char[], BSTR

real

DBTYPE_R4

float

smalldatetime

DBTYPE_DBTIMESTAMP

TIMESTAMP_STRUCT�

smallint

DBTYPE_I2

short�

smallmoney

DBTYPE_CY

long long

text

DBTYPE_IUNKNOWN, DBTYPE_STR

IUnknown, char[]

NoteSybase recommends you use streams through IUnknown interfaces, but it can also be bound as char[].

time

DBTYPE_DBTIME

TIME_STRUCT

timestamp

DBTYPE_BYTES

unsigned char[]

tinyint

DBTYPE_UI1

unsigned char�

unichar

DBTYPE_WSTR, DBTYPE_BSTR

wchar_t[], BSTR

univarchar

DBTYPE_WSTR, DBTYPE_BSTR

wchar_t[], BSTR

varbinary

DBTYPE_BYTES

unsigned char[]

varchar

DBTYPE_STR, DBTYPE_BSTR

char[], BSTR�