The following table lists the possible conversions from Open Client and Open Server datatypes to DB2 datatypes for parameters.
Open Client and Open Server datatype |
DB2 datatype |
---|---|
CS_BINARY |
CHAR FOR BIT DATA (default), VARCHAR FOR BIT DATA, GRAPHIC, VARGRAPHIC, LONG VARGRAPHIC |
CS_LONGBINARY |
CHAR FOR BIT DATA (default), VARCHAR FOR BIT DATA, GRAPHIC, VARGRAPHIC, LONG VARGRAPHIC |
CS_VARBINARY |
CHAR FOR BIT DATA (default), VARCHAR FOR BIT DATA, GRAPHIC, VARGRAPHIC, LONG VARGRAPHIC |
CS_BIT |
SMALLINT |
CS_CHAR |
CHAR |
CS_VARCHAR |
VARCHAR |
CS_LONGCHAR |
CHAR (default), VARCHAR, GRAPHIC, VARGRAPHIC, LONG VARGRAPHIC |
CS_DATETIME |
TIMESTAMP (default), DATE, TIME |
CS_DATETIME4 |
TIMESTAMP (default), DATE, TIME |
CS_TINYINT |
SMALLINT (all numeric types) |
CS_SMALLINT |
SMALLINT (all numeric types) |
CS_INT |
INT (all numeric types) |
CS_DECIMAL |
DECIMAL (all numeric types) |
CS_NUMERIC |
DECIMAL (all numeric types) |
CS_FLOAT |
FLOAT (all numeric types) |
CS_REAL |
REAL (all numeric types) |
CS_MONEY |
DECIMAL (all numeric types) |
CS_MONEY4 |
DECIMAL (all numeric types) |
CS_TEXT |
LONG VARCHAR |
CS_IMAGE |
LONG VARGRAPHIC |
The default DB2 type correspondence does not have to be exact. For example, DB2 accepts either CS_CHAR or CS_VARCHAR for either a DB2 CHAR or VARCHAR column. It also accepts any numeric type for any numeric column.
Copyright © 2005. Sybase Inc. All rights reserved. |