IBM DB2 SQL Data Types and DB2_DRV Driver - cDbUpdateFunctionLibrary


The table show how SQL data types maps to DataFlex native types and the capacity of each type.  The capacity shown is the highest possible value for the DataFlex side - or if the SQL side max value is lower - the SQL side capacity that is shown. Mostly it is the DataFlex side that has the lower capacity value.


SQL Type Name

SQL Type Constant

DataFlex Type

DataFlex Type

Constant

Capacity






DBCLOB

SQL_DBCLOP

Text

DF_TEXT

16384

BIGINT

SQL_BIGINT

Numeric

DF_BCD

14.0

BLOB

SQL_BLOB

Binary

DF_BINARY

16384

CHAR

SQL_CHAR

ASCII

DF_ASCII

254

CHAR FOR BIT DATA

SQL_CHARBIT

Binary

DF_BINARY

254

DATE

SQL_DATE

Date

DF_DATE

10.0

CLOB

SQL_CLOB

Text

DF_TEXT

16384

DECIMAL

SQL_DECIMAL

Numeric

DF_BCD

14.8

DOUBLE

SQL_DOUBLE

Numeric

DF_BCD

14.8

FLOAT

SQL_FLOAT

Numeric

DF_BCD

14.8

GRAPHIC

SQL_GRAPHIC

ASCII

DF_ASCII

255

INTEGER

SQL_INTEGER

Numeric

DF_BCD

9.0

LONG VARCHAR

SQL_LONGVARCHAR

Text

DF_TEXT

32000

LONG VARCHAR FOR BIT DATA

SQL_LONGVARCHARBIT

Binary

DF_BINARY

32000

LONG VARGRAPHIC

SQL_LONGVARGRAPHIC

Text

DF_TEXT

32000

NUMERIC

SQL_NUMERIC

Numeric

DF_BCD

14.8

REAL

SQL_REAL

Numeric

DF_BCD

14.8

SMALLINT

SQL_SMALLINT

Numeric

DF_BCD

5.0

TIME

SQL_TIME

ASCII

DF_ASCII

11.0

TIMESTAMP

SQL_TYPE_TIMESTAMP

DateTime

DF_DATETIME

23.6

VARCHAR

SQL_VARCHAR

Text

DF_TEXT

32672 (?)

VARCHAR FOR BIT DATA

SQL_VARCHARBIT

Binary

DF_BINARY

32672 (?)

VARGRAPHIC

SQL_VARGRAPHIC

Text

DF_TEXT

32672 (?)

XML

SQL_XML

Text

DF_TEXT

16384