Data type conversion reference between heterogeneous relational databases (MySQL and Oracle)

Source: Internet
Author: User
Tags local time

One, the transition from MySQL to Oracle data types:

Number

Mysql

Tooracle

Oracle

1

GEOMETRY

Blob

Blob

2

GeometryCollection

Blob

Blob

3

Multilinestring

Blob

Blob

4

LINESTRING

Blob

Blob

5

MULTIPOINT

Blob

Blob

6

Multipolygon

Blob

Blob

7

Point

Blob

Blob

8

POLYGON

Blob

Blob

9

DECIMAL

INTEGER

Number

10

DECIMAL (10)

INTEGER

Number

11

Blob

VARCHAR2 (2000)

Blob

12

BLOB (10)

VARCHAR2 (2000)

Blob

13

Longblob

VARCHAR2 (2000)

Blob

14

Mediumblob

VARCHAR2 (2000)

Blob

15

Tinyblob

VARCHAR2 (2000)

Blob

16

BINARY (10)

Blob

RAW

17

VARBINARY (10)

VARCHAR2 (2000)

RAW

18

Year

DATE

Number (3,0)

19

DOUBLE

Number

Binary_double( number also can)

20

FLOAT

Number

Binary_float( number also can)

21st

CHAR (2)

VARCHAR2 (2)

CHAR

22

NVARCHAR (10)

VARCHAR2 (10)

NVARCHAR

23

TEXT ( created after the table becomes tinytext)

VARCHAR2 (85)

Clob

24

REAL ( becomes Double after generating the table )

Number

Number

25

BIT

VARCHAR2 (2000)

RAW

26

ENUM (' test1 ', ' test2 ')

VARCHAR2 (5)

VARCHAR2

27

SET (' test1 ', ' test2 ')

VARCHAR2 (11)

VARCHAR2

28

Int

INTEGER

Number

29

TIMESTAMP

DATE

TIMESTAMP

30

BIGINT

INTEGER

Number

31

INT (8)

INTEGER

Number

32

Mediumini (10)

INTEGER

Number

33

SMALLINT (2)

INTEGER

Number

34

TINYINT

INTEGER

Number

35

Tinytext

VARCHAR2 (85)

Clob

36

VARCHAR

VARCHAR

VARCHAR

38

DATE

DATE

DATE

39

Datetime

Datetime

Datetime

40

Time

DATE

VARCHAR

41

Longtext

Clob

Clob

42

Mediumtext

Clob

Clob

II. Transformation of Oracle-to-MySQL data types

Number

Oracle

to MySQL

Mysql

1

Binary_double

Tinytext

DOUBLE

2

Binary_float

Tinytext

FLOAT

3

Blob

Longblob

Blob

4

CHAR

VARCHAR (2)

CHAR

5

DATE

UNKNOWN

DATE

6

INTERVAL Day Tosecond

Tinytext

Tinytext

7

INTERVAL year to MONTH

Tinytext

Tinytext

8

Number

DOUBLE

Number

9

NVARCHAR2

VARCHAR (20)

NVARCHAR2

10

RAW

VARCHAR (20)

11

TIMESTAMP

UNKNOWN

Datetime

12

TIMESTAMP (6) with LOCAL time ZONE

Tinytext

Tinytext

13

TIMESTAMP (6) with time ZONE

Tinytext

Tinytext

14

Clob

Mediumtext

Mediumtext

15

LONG

Tinytext

Tinytext

16

NCLOB

Mediumtext

Mediumtext

17

VARCHAR2

VARCHAR2

VARCHAR2

Data type conversion reference between heterogeneous relational databases (MySQL and Oracle)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.