Converting Adaptive Server datatypes to IQ

Table 7-5 shows how Adaptive Server datatypes are represented in Sybase IQ. When transferring the datatypes, Adaptive Server makes any necessary transformations to convert its data to the indicated IQ format.

Table 7-5: Adaptive Server to IQ datatype conversion

                        Adaptive Server

                           IQ

Datatype

Size (in bytes)

Datatype

Size (in bytes)

bigint unsigned bigint

8

bigint unsigned bigint

8

int unsigned int

4

int unsigned int

4

smallint

2

smallint

2

unsigned smallint

2

int

2

tinyint

1

tinyint

1

numeric(P,S) decimal(P,S)

2 – 17

numeric(P,S) decimal(P,S)

2 – 26

double precision

8

double

8

real

4

real

4

float(P)

4, 8

float(P)

4, 8

money

8

money IQ stores this as numeric(19,4)

16

smallmoney

4

smallmoney IQ stores this as numeric(10,4)

8

bigdatetime datetime

8

datetime

8

smalldatetime

4

smalldatetime

8

date

4

date

4

time

4

time

8

bigtime

8

time

8

char(N)

1 – 16296

char(N)

1 – 16296

char(N) (null)

1 – 16296

char(N) (null)

1 – 16296

varchar(N) (null)

1 – 16296

varchar(N) (null)

1 – 16296

unichar(N)

1– 8148

binary(N*2)

1 – 16296

unichar(N) nullunivarchar(N) (null)

1– 8148

varbinary(N*2) (null)

1 – 16296

binary(N)

1 – 16296

binary(N)

1 – 16296

varbinary(N)

1 – 16296

varbinary(N)

1 – 16296

binary(N) nullvarbinary(N) (null)

1 – 16296

varbinary(N) (null)

1 – 16296

bit

1

bit

1

timestamp

8

varbinary(8) null

8

Consider the following when converting Adaptive Server datatypes to datatypes for IQ: