In MySQL, I want to fire a trigger after the update of specific columns.
I know how to do it in Oracle and DB2:
CREATE TRIGGER myTrigger
A
You can't specify only to fire on specific column changes. But for a record change on a table you can do
delimiter |
CREATE TRIGGER myTrigger AFTER UPDATE ON myTable
FOR EACH ROW
BEGIN
...
END
|
delimiter ;
In your trigger you can refer to old and new content of a column like this
if NEW.column1 <> OLD.column1 ...