0% found this document useful (0 votes)
102 views

Mysql

DBConvert Tools allows for rapid and reliable conversion of databases between Oracle and MySQL. It allows users to select specific tables, fields, indexes and other database elements to convert. The tool offers both a wizard interface and command line mode to configure conversion options. Common functions, data types, constraints and other elements are converted between the database types.

Uploaded by

Anubha Verma
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Mysql

DBConvert Tools allows for rapid and reliable conversion of databases between Oracle and MySQL. It allows users to select specific tables, fields, indexes and other database elements to convert. The tool offers both a wizard interface and command line mode to configure conversion options. Common functions, data types, constraints and other elements are converted between the database types.

Uploaded by

Anubha Verma
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 19

DBConvert for Oracle and MySQL

DBConvert Tools allows to convert databases


rapidly and reliably. Operate with a whole
database or select only needed tables, fields,
indexes, foreign keys, queries and views to
proceed. Reach the desired result by simply
configuring of several options through Wizard
interface or in command line mode.
DBConvert tools are also applicable for
database conversion between the same

Converting Functions
NVL() -> IFNULL() or COALESCE()
DECODE() -> CASE() or IF()
Concatenating strings || -> CONCAT()
test || null returns test in Oracle
CONCAT(test,null) returns null in MySQL
LTRIM and RTRIM -> TRIM()
INSTR() works differently.
Use LOCATE() for Oracles INSTR() with occurrences = 1.
SUBSTRING_INDEX() and REVERSE() might also work.
ROWNUM --> LIMIT
NO DECODE() --> IF() CASE()
NO DUAL necessary (SELECT NOW())
SEQ.CURRVAL --> LAST_INSERT_ID()
SEQ.NEXTVAL --> NULL
%TYPE, %ROWTYPE, exceptions
Packages- shared package variables, built-in packages

Oracle

Mysql

AFTER trigger

trigger

BEFORE trigger

trigger

Check constraint

Check constraint

Column default

Column default

Database

Database

Foreign key

Foreign key

Index

Index

Package

N/A

PL/SQL function

Routine

PL/SQL procedure

Routine

Primary key

Primary key

Role

N/A

Schema

Schema

Sequence

AUTO_INCREMENT for a column

Snapshot

N/A

Synonym

N/A

Table

Table

Tablespace

N/A

Temporary table

Temporary table

Trigger for each row

Trigger for each row

Unique key

Unique key

User

User

View

View

STORED PROCEDURES
MYSQL

ORACLE

CREATE PROCEDURE adjust_emp_salary () BEGIN DECLARE


job_id INT; DECLARE employee_id INT DEFAULT 115;
DECLARE sal_raise DECIMAL(3,2); DECLARE EXIT
HANDLER FOR 1339; SELECT job_id INTO jobid FROM
employees WHERE employee_id = empid; CASE WHEN
jobid = 'PU_CLERK' THEN
SET sal_raise := .09; WHEN
jobid = 'SH_CLERK' THEN
SET sal_raise := .08; WHEN
jobid = 'ST_CLERK' THEN
SET sal_raise := .07; END
CASE;END;

CREATE OR REPLACE PROCEDURE adjust_emp_salary () AS


jobid employees.job_id%TYPE; empid
employees.employee_id%TYPE := 115; sal_raise
NUMBER(3,2);BEGIN SELECT job_id INTO jobid from
employees WHERE employee_id = empid; CASE WHEN
jobid = 'PU_CLERK' THEN
sal_raise := .09; WHEN jobid =
'SH_CLERK' THEN
sal_raise := .08; WHEN jobid =
'ST_CLERK' THEN
sal_raise := .07; END CASE;
EXCEPTION WHEN CASE_NOT_FOUND THEN
DBMS_OUTPUT.PUT_LINE('Employee salary not
adjusted.');END;

MySQL Data Type

Oracle Data Type

BIGINT

NUMBER(19, 0)

BIT

RAW

BLOB

BLOB, RAW

CHAR

CHAR

DATE

DATE

DATETIME

DATE

DECIMAL

FLOAT (24)

DOUBLE

FLOAT (24)

DOUBLE PRECISION

FLOAT (24)

ENUM

VARCHAR2

FLOAT

FLOAT

INT

NUMBER(10, 0)

INTEGER

NUMBER(10, 0)

LONGBLOB

BLOB, RAW

LONGTEXT

CLOB, RAW

MEDIUMBLOB

BLOB, RAW

MEDIUMINT

NUMBER(7, 0)

MEDIUMTEXT

CLOB, RAW

NUMERIC

NUMBER

REAL

FLOAT (24)

SET

VARCHAR2

SMALLINT

NUMBER(5, 0)

TEXT

VARCHAR2, CLOB

TIME

DATE

TIMESTAMP

DATE

TINYBLOB

RAW

TINYINT

NUMBER(3, 0)

TINYTEXT

VARCHAR2

VARCHAR

VARCHAR2, CLOB

YEAR

NUMBER

You might also like