1. Automatically increasing data type Processing
MYSQL has a data type that increases automatically. When you insert a record, you do not need to operate on this field. The data value is automatically obtained. ORACLE does not have an auto-increasing data type. You need to create an auto-increasing serial number. When inserting a record, you need to assign the next value of the serial number to this field.
Create sequence serial number name (preferably table name + Serial number mark) increment by 1 start with 1 MAXVALUE 99999 cycle nocache;
INSERT statement INSERT this field value: name of the serial number. NEXTVAL
2. Single quotes
MYSQL can use double quotes to enclose strings. ORACLE can only use single quotes to enclose strings. You must replace single quotes before inserting and modifying strings: replace all the existing single quotes with two single quotes. Of course, if you use the Convert Mysql to Oracle tool, you don't have to consider this issue.
3. Processing of long strings
In ORACLE, the maximum length of a string that can be operated during INSERT and UPDATE is less than or equal to 4000 single bytes. To INSERT a longer string, use the CLOB type for the field, use the DBMS_LOB package that comes with ORACLE. Before inserting a modification record, you must make a non-null and length judgment. If the field value cannot be blank or the field value beyond the length is exceeded, a warning should be given, and the last operation is returned.
4. Processing of paging SQL statements
The SQL statement that MYSQL uses to process pages is relatively simple. It uses LIMIT to start the position and record the number of records. It is complicated for ORACLE to process paging SQL statements. Each result set has only one ROWNUM field to indicate its position, and only ROWNUM <100, not ROWNUM> 80 can be used.
The following two SQL statements (ID is the field name of the unique keyword) are better after analysis ):
Statement 1:
Select id, [FIELD_NAME,...] FROM TABLE_NAME where id in (select id from (select rownum as numrow, id from TABLE_NAME WHERE Condition 1 order by condition 2) where numrow> 80 and numrow <100) order by Condition 3;
Statement 2:
SELECT * FROM (select rownum as numrow, c. * from (select [FIELD_NAME,...] FROM TABLE_NAME WHERE Condition 1 order by condition 2) c) where numrow> 80 and numrow <100) order by Condition 3;
5. Processing date fields
Mysql date fields are divided into DATE and TIME. The oracle date field is only DATE, which contains information about the year, month, day, hour, minute, and second. the system TIME of the current database is SYSDATE, accurate to seconds.
The mathematical formulas for date fields vary greatly. MYSQL uses DATE_FIELD_NAME> SUBDATE (NOW (), INTERVAL 7 DAY) to locate the current time seven days from the current time and uses DATE_FIELD_NAME> SYSDATE-7;
6. Fuzzy comparison of strings
MYSQL uses the field name like '% string %', and ORACLE can also use the field name like '% string %'. However, this method cannot use indexes and is not fast, if you use a string to compare the instr function (field name, 'string') to 0, you will get more accurate search results.
7. Handling of null characters
Non-empty fields in MYSQL are also empty. empty fields are not allowed in ORACLE. The ORACLE table structure is defined based on the not null value of MYSQL. errors may occur when data is imported. Therefore, when importing data, you need to judge the NULL character. If it is NULL or NULL, you need to change it to a space string.
Author: "column of zone8089653"