mysql insert trigger

Solutions on MaxInterview for mysql insert trigger by the best coders in the world

showing results for - "mysql insert trigger"
Leonardo
09 Jun 2018
1DELIMITER //
2
3CREATE TRIGGER contacts_after_insert
4AFTER INSERT
5   ON contacts FOR EACH ROW
6BEGIN
7   -- Insert record into audit table
8   INSERT INTO contacts_audit
9   ( contact_id,
10     created_date,
11     created_by)
12   VALUES
13   ( NEW.contact_id,
14     SYSDATE(),
15     "Admin" );
16END; //
17
18DELIMITER ;