Server class db2odbc

A server with server class db2odbc is IBM DB2.

Notes
  • Sybase certifies the use of IBM's DB2 Connect version 5, with fix pack WR09044. Configure and test your ODBC configuration using the instructions for that product. SQL Anywhere has no specific requirements for the configuration of DB2 data sources.

  • The following is an example of a CREATE EXISTING TABLE statement for a DB2 server with an ODBC data source named mydb2:

    CREATE EXISTING TABLE ibmcol
    AT 'mydb2..sysibm.syscolumns';
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