Audit Trigger

[expired user #7856]'s profile image [expired user #7856] posted 6 years ago in General Permalink

I'm new to triggers and cannot get this to work?

  • I need to log the old & new value of "omstatusID" only when it changes
  • The audit values need stored in tblAudit
  • Below is working SQL but not sure how to adapt it to work with HeidiSQL as a trigger?

INSERT INTO tblaudit(old_data, new_data, tbl_name) VALUES (OLD.omstatusID, NEW.omstatusID, "tblcom")

Please login to leave a reply, or register at first.