Data type conversions

When you issue a CREATE TABLE statement, Sybase IQ automatically converts the data types to the corresponding DB2 data types. The following table describes the Sybase IQ to DB2 data type conversions.

Sybase IQ data type

DB2 default data type

bit

smallint

tinyint

smallint

smallint

smallint

int

int

integer

int

bigint

decimal(20,0)

decimal [defaults precision=30, scale=6]

decimal(30,6)

decimal(128,128)

not supported

numeric [defaults precision=30, scale=6]

decimal(30,6)

numeric(128,128)

not supported

float

float

real

real

double

float

smallmoney

decimal(10,4)

money

decimal(19,4)

date

date

time

time

smalldatetime

timestamp

timestamp

timestamp

datetime

timestamp

char(1-254)

varchar(n)

character(255-4000)

varchar(n)

char(4001-32767)

long varchar

varchar(1-4000)

varchar(n)

varchar(4001-32767)

long varchar

character varying(1-4000)

varchar(n)

character varying(4001-32767)

long varchar

binary(1-255)

varchar for bit data

varbinary (256-4000)

varchar for bit data

varbinary(4001-32767)

long varchar for bit data

long binary

long varchar for bit data

text

long varchar