3
MySQL Data Types, Reserved Words, and Operators
This chapter describes the data types used within Oracle. It shows the MySQL data types and what is the Oracle equivelent. It also provides you with a list of reserved words within Oracle. It includes information on the following:
Supported Oracle Data Types
Table 3-1 describes the Oracle data types supported by the Migration Workbench.
Table 3-1 Oracle Data Types Supported by Oracle Migration Workbench
Refer to Oracle9i SQL Reference, Release 1 (9.0.1) for more information about Oracle data types.
Default Data Type Mappings
Table 3-2 shows the default settings used by the Migration Workbench to convert data types from MySQL to Oracle. The Migration Workbench allows you to change the default setting for certain data types by specifying an alternative type. You can do this in the Capture Wizard or in the Data Type Mappings page of the Options dialog box.
Refer to the Oracle Migration Workbench Online Help for more information about changing the default data type mappings.
Table 3-2 Default Data Type Mappings Used by Oracle Migration Workbench
Note:
The Enum data type has no direct mapping in Oracle. The Migration Workbench maps Enum columns in MySQL to Varchar2 columns in Oracle. It then adds a constraint to those columns to ensure that only values that were allowed by the Enum data type are allowed in the column it was mapped to in Oracle.
The Set data type has no direct mapping in Oracle. The current version of the Migration Workbench maps Set columns in MySQL to Varchar2 columns in Oracle.
|
Comparing MySQL to Oracle
The following tables represent the mappings of the datatypes between MySQL and Oracle. For some MySQL datatypes there is more than one alternative Oracle datatype. The tables include information on the following:
Numeric Types
In the case of MySQL data types that map to numeric datatypes in Oracle the following conditions apply:
- If there is no precision or scale defined for the destination Oracle data type then precision and scale are taken from the MySQL source data type.
- If there is a precision or scale defined for the destination data type then these values are compared to the equivalent values of the source data type and the maximum value is selected.
The following table compares the numeric types of MySQL to Oracle:
Date and Time Types
The following table compares the date and time types of MySQL to Oracle:
String Types
In the case of MySQL data types that map to character data types in Oracle, the following conditions apply:
- If there is no length defined for the destination data type then the length is taken from the source datatype.
- If there is a length defined for the destination data type then the maximum value of the two lengths is taken.
Note:
Reference to M indicates the maximum display size. The maximum legal display size is 255. While a reference to L applies to a floating point types and indicates the number of digits following the decimal point.
|
The following compares the string types of MySQL to Oracle:
Oracle Reserved Words
The words are reserved in Oracle. The Migration Workbench appends an underscore to any object names that conflict with these reserved words.
ABORT
|
ACCEPT
|
ACCESS
|
ADD
|
ALL
|
ALTER
|
AND
|
ANY
|
ARRAY
|
ARRAYLEN
|
AS
|
ASC
|
ASSERT
|
ASSIGN
|
AT
|
AUDIT
|
AUTHORIZATION
|
AVG
|
BASE_TABLE
|
BEGIN
|
BETWEEN
|
BINARY_INTEGER
|
BODY
|
BOOLEAN
|
BY
|
CASE
|
CHAR
|
CHAR_BASE
|
CHECK
|
CLOSE
|
CLUSTER
|
CLUSTERS
|
COLAUTH
|
COLUMN
|
COMMENT
|
COMMIT
|
COMPRESS
|
CONNECT
|
CONSTANT
|
CRASH
|
CREATE
|
CURRENT
|
CURRVAL
|
CURSOR
|
DATA_BASE
|
DATABASE
|
DATE
|
DBA
|
DEBUGOFF
|
DEBUGON
|
DECIMAL
|
DECLARE
|
DEFAULT
|
DEFINITION
|
DELAY
|
DELETE
|
DESC
|
DIGITS
|
DISPOSE
|
DISTINCT
|
DO
|
DROP
|
ELSE
|
ELSIF
|
END
|
ENTRY
|
EXCEPTION
|
EXCEPTION_INIT
|
EXCLUSIVE
|
EXISTS
|
EXIT
|
FALSE
|
FETCH
|
FILE
|
FLOAT
|
FOR
|
FORM
|
FROM
|
FUNCTION
|
GENERIC
|
GOTO
|
GRANT
|
GROUP
|
HAVING
|
IDENTIFIED
|
IF
|
IMMEDIATE
|
IN
|
INCREMENT
|
INDEX
|
INDEXES
|
INDICATOR
|
INITIAL
|
INSERT
|
INTEGER
|
INTERFACE
|
INTERSECT
|
INTO
|
IS
|
LEVEL
|
LIKE
|
LIMITED
|
LOCK
|
LONG
|
LOOP
|
MAX
|
MAXEXTENTS
|
MIN
|
MINUS
|
MLSLABEL
|
MOD
|
MODE
|
MODIFY
|
NATURAL
|
NATURALN
|
NETWORK
|
NEW
|
NEXTVAL
|
NOAUDIT
|
NOCOMPRESS
|
NOT
|
NOWAIT
|
NULL
|
NUMBER
|
NUMBER_BASE
|
OF
|
OFFLINE
|
ON
|
ONLINE
|
OPEN
|
OPTION
|
OR
|
ORDER
|
OTHERS
|
OUT
|
PACKAGE
|
PARTITION
|
PCTFREE
|
PLS_INTEGER
|
POSITIVE
|
POSITIVEN
|
PRAGMA
|
PRIOR
|
PRIVATE
|
PRIVILEGES
|
PROCEDURE
|
PUBLIC
|
RAISE
|
RANGE
|
RAW
|
REAL
|
RECORD
|
REF
|
RELEASE
|
REMR
|
RENAME
|
RESOURCE
|
RETURN
|
REVERSE
|
REVOKE
|
ROLLBACK
|
ROW
|
ROWID
|
ROWLABEL
|
ROWNUM
|
ROWS
|
ROWTYPE
|
RUN
|
SAVEPOINT
|
SCHEMA
|
SELECT
|
SEPERATE
|
SESSION
|
SET
|
SHARE
|
SIGNTYPE
|
SIZE
|
SMALLINT
|
SPACE
|
SQL
|
SQLCODE
|
SQLERRM
|
START
|
STATEMENT
|
STDDEV
|
SUBTYPE
|
SUCCESSFUL
|
SUM
|
SYNONYM
|
SYSDATE
|
TABAUTH
|
TABLE
|
TABLES
|
TASK
|
TERMINATE
|
THEN
|
TO
|
TRIGGER
|
TRUE
|
TYPE
|
UID
|
UNION
|
UNIQUE
|
UPDATE
|
USE
|
USER
|
VALIDATE
|
VALUES
|
VARCHAR
|
VARCHAR2
|
VARIANCE
|
VIEW
|
VIEWS
|
WHEN
|
WHENEVER
|
WHERE
|
WHILE
|
WITH
|
WORK
|
WRITE
|
XOR
|
|