Tech Tip: System table column OLD_DATA_TYPE
PRODUCT: 4D SQL | VERSION: 12 | PLATFORM: Mac & Win
Published On: June 9, 2011
There is a system column OLD_DATA_TYPE that is available in the _USER_COLUMNS system table. The column type is a long integer and this column stores the 4D data type of a given column.
This value is different from the DATA_TYPE column, which represents the SQL data type of a given column. See the Tech Tip 4D Data Types in SQL System Tables for more information on the DATA_TYPE column.
Here is a table which shows the 4D field types and the corresponding values for DATA_TYPE and OLD_DATA_TYPE:
Field type | DATA_TYPE | OLD_DATA_TYPE |
Alpha | 10 | 0 |
BLOB | 18 | -1 |
Boolean | 1 | 6 |
Date | 8 | 4 |
Float | 7 | -7 |
Integer | 3 | 8 |
Integer 64 Bits | 5 | -5 |
Long Integer | 4 | 9 |
Picture | 12 | 3 |
Real | 6 | 1 |
Text | 10 | 2 |
Time | 9 | 11 |
This information can be used to extract information about a field, given its tablename and fieldname.
For more information on system tables see the 4D SQL Reference, "Principles for integrating 4D and the 4D SQL engine".
Note: This column was introduced in 11.2.