MySQL Forums
Forum List  »  Triggers

How To Code This Trigger
Posted by: Chris Thompson
Date: January 12, 2013 05:49PM

Hi All,

I'm wondering if someone can help me with coding a trigger based on the following code ? I'm a bit rusty with Triggers and this one is especially complicated for me. I've tried to simplify the code a bit with some generic terms. The basic idea of what I want to do is>:

IF (SELECT target_field1 FROM Database1.Table WHERE verificationfield1 = 'data') <>
(SELECT target_field2 FROM Database2.Table WHERE verificationfield2 = 'data')
THEN
UPDATE Database1.Table
SET target_field1 = (SELECT target_field2 FROM Database2.Table WHERE verificationfield2 = 'data')
WHERE verificationfield1 = 'data'
END IF;

I'm looking to fire this trigger AFTER an UPDATE to the Database2.Table field. Any help would be tremendously appreciated.

Options: ReplyQuote


Subject
Views
Written By
Posted
How To Code This Trigger
2485
January 12, 2013 05:49PM
1041
January 15, 2013 03:52AM


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.