Oracle 5.0 Reference Manual page 882

Table of Contents

Advertisement

Using Data Types from Other Database Engines
To facilitate the use of code written for SQL implementations from other vendors, MySQL maps data
types as shown in the following table. These mappings make it easier to import table definitions from
other database systems into MySQL.
Other Vendor Type
BOOL
BOOLEAN
CHARACTER VARYING(M)
FIXED
FLOAT4
FLOAT8
INT1
INT2
INT3
INT4
INT8
LONG VARBINARY
LONG VARCHAR
LONG
MIDDLEINT
NUMERIC
Data type mapping occurs at table creation time, after which the original type specifications are
discarded. If you create a table with types used by other vendors and then issue a
statement, MySQL reports the table structure using the equivalent MySQL types. For
tbl_name
example:
mysql>
CREATE TABLE t (a BOOL, b FLOAT8, c LONG VARCHAR, d NUMERIC);
Query OK, 0 rows affected (0.00 sec)
mysql>
DESCRIBE t;
+-------+---------------+------+-----+---------+-------+
| Field | Type
+-------+---------------+------+-----+---------+-------+
| a
| tinyint(1)
| b
| double
| c
| mediumtext
| d
| decimal(10,0) | YES
+-------+---------------+------+-----+---------+-------+
4 rows in set (0.01 sec)
MySQL Type
TINYINT
TINYINT
VARCHAR(M)
DECIMAL
FLOAT
DOUBLE
TINYINT
SMALLINT
MEDIUMINT
INT
BIGINT
MEDIUMBLOB
MEDIUMTEXT
MEDIUMTEXT
MEDIUMINT
DECIMAL
| Null | Key | Default | Extra |
| YES
|
| NULL
| YES
|
| NULL
| YES
|
| NULL
|
| NULL
862
|
|
|
|
|
|
|
|
DESCRIBE

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents