MySQL Forums
Forum List  »  Triggers

Triggers in Oracle needs to work in MySQL
Posted by: John Doe
Date: March 06, 2006 12:36PM

I am trying to convert this Oracle code to do the same thing in Oracle. Can anyone tell me if there is attribure or field based trigger activation in MySQL as in Oracle and illustrated in the code below. I had a thought that maybe MySQL has built-in optimization to include this feature, can i be right or wrong here?

CREATE OR REPLACE TRIGGER "SAMPLE" AFTER
UPDATE OF "STATUS" ON "MYSAMPLE" FOR EACH ROW
WHEN (
(NEW.SERVICECODE = 3) AND (NEW.STATUS = 'In Progress')
)
DECLARE
THIS_CBT BIGINT;
BEGIN
SELECT CBTBIGINT INTO THIS_CBT FROM SAMPLEEXTN WHERE SAMPLEID = :NEW.ID;
IF (THIS_CBT IS NULL) THEN
UPDATE SAMPLEEXTN SET CBTBIGINT = Next_Value_Func('CBTBIGINT') WHERE SAMPLEID = :NEW.ID;
END IF;
END;
/
SHOW ERRORS;

I am also wondering how the Migration Toolkit can help me with migrating triggers.

Any thoughts, ideas, and information about similar experience will be greatly appreciated.



Edited 1 time(s). Last edit at 03/06/2006 12:40PM by John Doe.

Options: ReplyQuote


Subject
Views
Written By
Posted
Triggers in Oracle needs to work in MySQL
2586
March 06, 2006 12:36PM


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.