MySQL Forums
Forum List  »  Triggers

How to convert oracle scripts to mysql
Posted by: lokesh kumar
Date: April 27, 2012 03:21AM

Hi,

I have been working on the migration of database from oracle to mysql.
I have modified all the data types in the columns of the tables.

But I have been struggling with the conversion of oracle scripts into mysql.

Below i am pasting a trigger which was written oracle and i want to convert this one into mysql.

CREATE OR REPLACE PACKAGE STATE_PKG AS
NID VARCHAR2(100);
NPASSWORD VARCHAR2(100);
ENCR_DATA VARCHAR2(100);
END;
/

CREATE OR REPLACE TRIGGER HASHPASSWORD_PARENT
AFTER INSERT ON USER_MASTER
BEGIN
/* CREATE A HASH OF PASSWORD USING MD5 */
STATE_PKG.ENCR_DATA := DBMS_OBFUSCATION_TOOLKIT.MD5(INPUT_STRING => STATE_PKG.NPASSWORD);

/* UPDATE THE ENCRYPTED PASSWORD HASH ON PASSWORD COLUMN */
UPDATE USER_MASTER SET PASSWORD = STATE_PKG.ENCR_DATA WHERE USER_ID = STATE_PKG.NID;
END;
/

CREATE OR REPLACE TRIGGER HASHPASSWORD_AFTER_INSERT
AFTER INSERT ON USER_MASTER FOR EACH ROW
BEGIN
STATE_PKG.NID := :NEW.USER_ID;
STATE_PKG.NPASSWORD := :NEW.PASSWORD;
END;
/

CREATE OR REPLACE TRIGGER HASHPASSWORD_BEFORE_INSERT
BEFORE INSERT ON USER_MASTER
BEGIN
STATE_PKG.NID := ' ';
STATE_PKG.NPASSWORD := ' ';
STATE_PKG.ENCR_DATA := ' ';
END;
/

Please can any body suggest me how to convert this into mysql script.
I have googled lot of sites for the conversion tools, but i did not find any thing.

I need an help regarding the conversion.

Regards,
Lokesh

Options: ReplyQuote


Subject
Views
Written By
Posted
How to convert oracle scripts to mysql
6544
April 27, 2012 03:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.