September 19th, 2008
Introduction to Data Types, Part 3 of 3
Posted by
admin in
F. Data Types
For a RDBMS system, such as DB2, the values and physical lengths of the data are as follows:
TYPE VALUES PHYSICAL LENGTH Character columns: CHAR(length) Any Character 1 to 254 + 1 VARCHAR(max) Any Character 1 to 254 + 1 LONG VARCHAR(max) Any Character 1 to 32,765
Numeric columns:
DECIMAL(total,fract) 30 (15) Digits total/2 + 1
INTEGER +- 2,147,483,647 5
SMALL INTEGER +- 32,767 3
FLOAT(length) -5.4E-79 to +7.2E+75 5 if length from 1 to 21
9 if length from 22 to 53
Date/Time columns: DATE 00010101 to 99991231 5 TIME 00:00 to 23:59 4 TIMESTAMP Any Date-Time 11
Graphic columns: GRAPHIC(length) Any DBCS graphic 2*length + 1 (2 to 254 + 1) VARGRAPHIC(length) Any DBCS graphic 2*length + 1 (2 to 254 + 3) LONG VARGRAPHIC(length) Any DBCS graphic 2*length + 3 to data page size
Check with your RDBMS documentation to confirm the values and physical length of data used by your system.
Comments Off