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 ;

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.