ASA SQL User's Guide
Server Classes for Remote Data Access
ODBC-based server classes
Server class db2odbc
When you issue a CREATE TABLE statement, Adaptive Server Anywhere automatically converts the data types to the corresponding DB2 data types. The following table describes the Adaptive Server Anywhere to DB2 data type conversions.
Adaptive Server Anywhere data type | DB2 default data type |
---|---|
Bit | smallint |
Tinyint | smallint |
Smallint | smallint |
Int | int |
Integer | int |
Bigint | decimal(20,0) |
char(1-254) | varchar(n) |
char(255-4000) | varchar(n) |
char(4001-32767) | long varchar |
Character(1-254) | varchar(n) |
Character(255-4000) | varchar(n) |
Character(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 |
long varchar | long varchar |
text | long varchar |
binary(1-4000) | varchar for bit data |
binary(4001-32767) | long varchar for bit data |
long binary | long varchar for bit data |
image | long varchar for bit data |
decimal [defaults p=30, s=6] | decimal(30,6) |
numeric [defaults p=30 s=6] | decimal(30,6) |
decimal(128, 128) | NOT SUPPORTED |
numeric(128, 128) | NOT SUPPORTED |
real | real |
float | float |
double | float |
smallmoney | decimal(10,4) |
money | decimal(19,4) |
date | date |
time | time |
smalldatetime | timestamp |
datetime | timestamp |
timestamp | timestamp |