0

I have created this Trigger. However, when inserting into dbase, nothing happens?

DELIMITER $$

USE `collectionsmax`$$

CREATE
    TRIGGER `DupeCheck` AFTER INSERT ON `dbase` 
    FOR EACH ROW BEGIN
        update dbase set reportfilenumber=socialsecruitynumber where id = new.id;
    END;
$$

DELIMITER ;
Adam Reed
  • 229
  • 4
  • 16

1 Answers1

1

You can't execute DML statements against the table your trigger is written against. This is a caveat in most databases.

See MySQL - Trigger for updating same table after insert. The accepted answer has a different way of approaching the same problem.

Community
  • 1
  • 1
Tripp Kinetics
  • 5,178
  • 2
  • 23
  • 37
  • Unfortunately that will not work in my situation. A 3rd party application is making the INSERT into my DB, and I need to actively run this Trigger when this happens. – Adam Reed Jan 16 '15 at 20:40