Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Server Classes for Remote Data Access » ODBC-based server classes » Server class db2odbc

Server class db2odbc Next Page

Data type conversions: DB2

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

SQL 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