DataFlex Replacement Data Types - cDbUpdateFunctionLibrary
When using the framework's embedded SQL (ESQL) functions for making changes to a database, the developer has two choices for specifying the data type to be used. This is true for functions like SQLColumnAdd where the new column's data type needs to be specified.
Either use one of the integer constants of the "Framework Type Constant" from the table below and the framework will use the database driver to map to an SQL data type that matches the DF_XXX_DUF constant. Better is to use one of the "SQL Type Constant" from one of the tables on the next few pages, that corresponds to the SQL database back-end and driver used. The latter is the recommended way as it gives you much better control over which data type is used when creating a new SQL column.
The reason we need to have our "own" defined integer constants is that some of the SQL driver's data types uses the same integer values as the DataFlex type constants and thus it is impossible for the framework to know which data type the developer refers to.
Data Type |
Framework Type Constant |
Framework Integer Constant |
DataFlex Type Constant |
DataFlex Integer Constant |
ASCII |
DF_ASCII_DUF |
-1500 |
DF_ASCII |
0 |
Numeric |
DF_BCD_DUF |
-1499 |
DF_BCD |
1 |
Binary |
DF_BINARY_DUF |
-1494 |
DF_BINARY |
6 |
Date |
DF_DATE_DUF |
.1498 |
DF_DATE |
2 |
DateTime |
DF_DATETIME_DUF |
.1493 |
DF_DATETIME |
7 |
Text |
DF_TEXT_DUF |
-1495 |
DF_TEXT |
5 |
The framework type constants has a value of the DataFlex constant - 1500, to distinguish them from other driver SQL data types.
Note: You should NEVER use any of the standard DataFlex data type constants; DF_ASCII, DF_DATE, DF_BCD etc. when using one of the "SQLxxx" functions or the result will be unpredictable!