MYSQL DATATYPES
From KallestadWiki
Contents |
Overview
This page describes mysql datatypes for the KDF Engine. I personally am running MySQL 4.1 as of the time of this writing, so I pulled the information directly from the MySQL 4.1 Manual (also here). More information is on that page about MySQL specifics.
Numeric Types
Numeric types all take a length parameter that specifies the number of digits that can be displayed. This can be ommitted. The length is restricted by the datatype - for instance, TINYINT can store values from -128 to 127 or 0-255 unsigned. TINYINT(1) can display values from -9 to 9 or 0-9 unsigned. TINYINT(5) can still only display values from -128 to 127 (or 0-255), even though there are only 3 digits in those numbers.
Numeric types that require decimal precision, also accept a secondary parameter indicating the number of decimals to store in the database. For instance FLOAT(3,2) would store numbers from -999.99 to 999.99 or 0-999.99 unsigned. In KDF, simply place 2 comma separated values in the lv object.
The ZEROFILL attribute implies UNSIGNED. ZEROFILL pads results with zeros so that the maximum display width is always returned. (i.e. TINYINT(3) ZEROFILL for numeric value 10 returns '010')
TINYINT (1 byte | -128 to 127 | 0 to 255) SMALLINT (2 bytes | -32768 to 32767 | 0 to 65535) MEDIUMINT (3 bytes | -8388608 to 8388607 | 0 to 16777215) INT (4 bytes | -2147483648 to 2147483647 | 0 to 4294967295) BIGINT (8 bytes | -9223372036854775808 to 9223372036854775807 | 0 to 18446744073709551615) DOUBLE (-1.7976931348623157E+308 to -2.2250738585072014E-308 | 0 to 2.2250738585072014E-308) FLOAT NOT RECOMMENDED - All MySQL calculations are done with double precision, potentially causing problems with single precision floats. DECIMAL (-1.7976931348623157E+308 to -2.2250738585072014E-308 | 0 to 2.2250738585072014E-308) Stored unpacked in DB as character values
String Types
Date Types
Kallestad Development Framework Topics
- KDF Home
- Project Overview
- Technical Information
- Licensing
