411 REFERENCE · Wikibooks
Oracle and DB2, Comparison and Compatibility/Storage Model/Data Types/DB2
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
DB2
Character Data Types
500px|none
If the length of the character data varies significantly, VARCHAR is more efficient because CHAR will pad the field with blanks to the length of CHAR(n). These blanks will be transmitted across the network. If the size of actual data does not vary much, CHAR is more efficient since each VARCHAR field has a few bytes of length information.
Numeric Data Types
500px|none
Date Data Types
500px|none
DB2 has a series of special registers that are storage areas that can be referenced in SQL statements. CURRENT TIMEZONE specifies the TIMEZONE parameter in the form of a time duration with a data type of DECIMAL(6,0) in the format HHMMSS. The time duration is derived by the instance that executes the SQL statement. To get the CURRENT TIME or CURRENT TIMESTAMP adjusted to GMT/UTC, subtract the CURRENT TIMEZONE register from the CURRENT TIME or TIMESTAMP.
The assumption is that the clock is set to local time and the TIMEZONE parameter is zero, or the clock is set to GMT and the TIMEZONE parameter gives the difference from GMT.
LOB Data Types
500px|none
Graphic Data Types
500px|none
ROWID Data Type
500px|none
XML Data Type
500px|none