In oracle to Mysql, what type should varchar2(10) and number be converted to?

1. What type should varchar2(10) and number be converted to?

When oracle is converted to mysql:
varchar2(10) can be converted to varchar(10)
number depends on what type of data is stored in oracle:
1. If it is an integer, then in mysql, use int;
2. If it is with decimal places, the numeric type is available in mysql.

Note: There are no two data types varchar2(10) and number in mysql

 

二. Mysql varchar VS Oracle varchar2

MySQL and Oracle do data synchronization. One of the fields of the table is set to varchar(6) in mysql, and varchar2(6)
in Oracle , but the data that can be stored normally in mysql is synchronized to oracle, but ORA-12899: value too large for column error occurs.
Why is this?

In mysql, varchar(6) means that 6 Chinese characters, 6 letters, or 6 numbers can be stored.
In oracle, varchar2(6) can store 6 bytes. That is, the length of varchar2 in oracle represents the number of bytes rather than the number of characters.
A Chinese character in mysql occupies three bytes, and a Chinese character in Oracle occupies two bytes.

 

Although the fields in mysql varchar and orache varchar2 are set to the same length, they cannot be stored in oracle.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326679154&siteId=291194637