Adam Reed
Adam Reed

Reputation: 229

MySQL Trigger Not Functioning

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 ;

Upvotes: 0

Views: 47

Answers (1)

Tripp Kinetics
Tripp Kinetics

Reputation: 5439

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.

Upvotes: 1

Related Questions