Following create statement for trigger not working:
DROP TRIGGER IF EXISTS `bid_AFTER_INSERT` ;
DELIMITER |
CREATE DEFINER = CURRENT_USER TRIGGER `blah`.`bid_AFTER_INSERT` AFTER INSERT ON `bid` FOR EACH ROW
BEGIN
call sp_internal_bid_history_updation_on_bid_insert("bid","created_date",null,new.created_date,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","created_id",null,new.created_id,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","name",null,new.name,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","first_delivery",null,new.first_delivery,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","email",null,new.email,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","final_delivery",null,new.final_delivery,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","master_bid_id",null,new.final_delivery,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","partner_id",null,new.partner_id,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","orders_id",null,new.orders_id,new.id);
END
|
DELIMITER ;
Getting following error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER' at line 1
DELIMITER $$
CREATE TRIGGER `insightbasev2`.`bid_AFTER_INSERT` AFTER INSERT ON `bid`
FOR EACH ROW
BEGIN
call sp_internal_bid_history_updation_on_bid_insert("bid","created_date",null,new.created_date,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","created_id",null,new.created_id,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","name",null,new.name,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","first_delivery",null,new.first_delivery,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","email",null,new.email,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","final_delivery",null,new.final_delivery,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","master_bid_id",null,new.final_delivery,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","partner_id",null,new.partner_id,new.id);
call sp_internal_bid_history_updation_on_bid_insert("bid","orders_id",null,new.orders_id,new.id);
END
DELIMETER ;
Just try above code.
I had tried it and it's working fine for me.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.