locked
MySql Trigger RRS feed

  • Question

  • User-282339866 posted

    i am having big difficulties creating my first trigger in Mysql,., i tried below code

    DELIMITER $$

    CREATE TRIGGER firstTrigger
    AFTER INSERT ON log_master
    BEGIN
    UPDATE log_master set username='rishavUpDat2' where user_id=1;
    END$$
    delimiter ;
    what am i doing wrong ,
    please help
    thanku
    Saturday, January 14, 2012 2:59 AM

Answers

  • User1501365188 posted
    DELIMITER $$
    
    DROP TRIGGER /*!50032 IF EXISTS */ `test`.`firstTrigger`$$
    
    CREATE TRIGGER `test`.`firstTrigger` AFTER INSERT on `test`.`login`
    FOR EACH ROW BEGIN
    UPDATE login set UserName='rishavUpDat2' where recID=1;
    
    END$$
    
    DELIMITER ;
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, January 14, 2012 6:44 AM