MySQL Forums
Forum List  »  Triggers

Re: INSERT INTO on AFTER UPDATE trigger
Posted by: Peter Brawley
Date: June 26, 2020 09:16AM

> I want to insert a record into the row_change table
> for each field that changed in the trigger field:

You mean the requirement is to insert a row_change row for every `field` column where the NEW column value differs from the OLD? That'll require a block like ...

if new.col1 <> old col1 then
  insert into row_change ...
end if;

... for each `field` column.

Options: ReplyQuote


Subject
Views
Written By
Posted
540
June 26, 2020 06:21AM
Re: INSERT INTO on AFTER UPDATE trigger
189
June 26, 2020 09:16AM


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.