EGL assumes a default mapping between EGL types and SQL types. EGL uses the mapping at declaration time, validation time, and run time. For a table showing that mapping, see Retrieving SQL table data in the EGL Programmer's Guide.
To override this default mapping in DB2®, you can use the SQL field level sqlDataCode property. This property used to be necessary in code migrated from VisualAge Generator, which lacked equivalents for many current EGL data types. The property is maintained primarily for compatibility with earlier versions.
Record ExampleSQLRecord type SQLRecord myHexVar HEX(8) {sqlDataCode = 497}; // matches SQL INTEGER end
The following table shows sqlDataCode values in DB2 for the various SQL data types.
SQL data type | sqlDataCode |
---|---|
BIGINT | 493 |
BIT | n/a in DB2 |
BLOB | 405 |
BOOLEAN | n/a in DB2 |
CHAR | 453 |
CLOB | 409 |
DATE | 385 |
DECIMAL | 485 |
DOUBLE | 481 |
FLOAT | 481 |
GRAPHIC | 469 |
INTEGER | 497 |
LONG VARBINARY | 481 |
LONG VARCHAR | 457 |
LONG VARGRAPHIC | 473 |
NUMERIC | 485 |
REAL | 481 |
SMALLINT | 501 |
TIME | 389 |
TIMESTAMP | 393 |
VARBINARY | 481 |
VARCHAR | 449 |
VARGRAPHIC | 465 |