tags:

views:

808

answers:

1

I have a query like following:

delimiter $$
DROP TRIGGER IF EXISTS TR_SCIN_BANK_UPD$$
CREATE TRIGGER TR_SCIN_BANK_UPD
AFTER UPDATE ON SCIN_BANK
FOR EACH ROW
BEGIN
  IF OLD.BANK_NAME != NEW.BANK_NAME THEN
    INSERT into SCIN_BANK_LOG SET BANK_ID=OLD.BANK_ID, BANK_NAME=OLD.BANK_NAME, LAST_UPD_USER_ID=OLD.LAST_UPD_USER_ID, LAST_UPD_TS=now();
  END IF;
  IF OLD.BANK_DESC != NEW.BANK_DESC THEN
    INSERT into SCIN_BANK_LOG SET BANK_ID=OLD.BANK_ID, BANK_DESC=OLD.BANK_DESC, LAST_UPD_USER_ID=OLD.LAST_UPD_USER_ID, LAST_UPD_TS=now();
  END IF;
END$$

when executing I get

This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'

this error can any one provide solution for this?

+1  A: 

I guess there already is an AFTER UPDATE trigger on that table, but it is not named TR_SCIN_BANK_UPD, meaning that your DROP TRIGGER IF EXISTS line does nothing.

Tomalak