Datatype Syntax | Maximun Size |
---|---|
CHAR(size) | Max Size 255 Characters |
VARCHAR(Size) | Max Size 255 Characters |
TEXT(Size) | Max size of 65,535 characters |
BINARY(size) | Maximum size of 255 characters |
VARBINARY(size) | Maximum size of 255 characters |
Datatype Syntax | Maximum Size |
---|---|
BIT | Very small integer value. Signed values range from -128 to 127. Unsigned values range from 0 to 255. |
FLOAT(p) | Floating point number |
BOOLEAN | Synonym for TINYINT |
INT(m) | Standard integer value. Signed values range from -2147483648 to 2147483647. Unsigned values range from 0 to 4294967295. |
INTEGER(m) | Standard integer value. Signed values range from -2147483648 to 2147483647. Unsigned values range from 0 to 4294967295. |
NUMERIC(m,d) | Unpacked fixed-point number. m defaults to 10, if not specified. d defaults to 0, if not specified. |
DOUBLE(m,d) | Double precision floating point number. |
DOUBLE PRECISION(m,d) | Double precision floating point number |
YEAR
data sort.
The following are the Date/Time Datatypes in DB2.
Datatype Syntax | Maximumn Size | Explanation |
---|---|---|
DATE | Values range from '1000-01-01' to '9999-12-31' | Displayed as 'YYYY-MM-DD' |
TIME | Values range from '-838:59:59' to '838:59:59' | Displayed as 'HH:MM:SS' |
YEAR[(2|4)] | Year value as 2 digits or 4 digits | Default is 4 digits |
DATETIME | Values range from '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. | Displayed as 'YYYY-MM-DD HH:MM:SS' |
Datatype Syntax | Maximumn Size |
---|---|
TINYBLOB | Maximum size of 255 bytes |
BLOB(size) | Maximum size of 65,535 bytes |
LONGTEXT | Maximum size of 4GB or 4,294,967,295 characters |