Re: trigger with condition
Two problems ...
1. The Trigger is defined on sourcetable but the Update statement fails to refer to it.
2. The Join is missing a joining condition.
Some logic is missing from your description, so I can only guess at the solution, something like ...
CREATE TRIGGER ‘sync’ AFTER UPDATE ON sourcetable FOR EACH ROW
BEGIN
UPDATE db_destination.table_content d
JOIN sourcetable s ON d.destination_id=s.source_id
SET d.introtext = s.introtext
WHERE d.destination_id = NEW.source_id;
END;
Read the manual page for Triggers to see how to use NEW and OLD.
Subject
Views
Written By
Posted
2719
November 29, 2013 07:01AM
Re: trigger with condition
1380
November 29, 2013 12:27PM
1430
November 29, 2013 02:21PM
1327
November 30, 2013 04:03PM
1354
November 30, 2013 11:37PM
1283
December 01, 2013 03:52AM
1279
December 01, 2013 01:46PM
1300
December 01, 2013 03:21PM
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.