MySQL error code 1235

前端 未结 2 1806
礼貌的吻别
礼貌的吻别 2020-12-17 11:09

In MySQL I tried to define a trigger like this:

DELIMITER $$  
CREATE TRIGGER vipInvite  
AFTER INSERT ON meetings  
         


        
2条回答
  •  盖世英雄少女心
    2020-12-17 11:22

    How to reproduce this error in MySQL:

    ERROR 1235 (42000): This version of MySQL doesn't yet support 'multiple 
    triggers with the same action time and event for one table'
    

    Run the following queries:

    DELIMITER //
    CREATE TRIGGER mytrigger1 AFTER INSERT ON mytable
    FOR EACH ROW
    BEGIN
    END//
    
    DELIMITER //
    CREATE TRIGGER mytrigger2 AFTER INSERT ON mytable
    FOR EACH ROW
    BEGIN
    END//
    

    If you want to hook more than one action onto the same event/table, you will have to cram all of it into one trigger. You could call many stored procedures like this:

    DELIMITER //
    CREATE TRIGGER mytrigger1 AFTER INSERT ON mytable
    FOR EACH ROW
    BEGIN
        CALL fromulate_the_moobars(NEW.myid);
        CALL its_peanut_butter_jelly_time(NEW.myname);
    END//
    

提交回复
热议问题