1 year ago
#386801
Phan Quang Thang
Mysql-how to assign value from a field of select into local variable?
I'm trying to assign a value from a field of a select statement to a local variable in my trigger. Does it have any way to do that? Any help would be very appreciated My trigger
DELIMITER $$
CREATE TRIGGER update_cart_total
before insert
ON core_cartdetails FOR EACH ROW
BEGIN
declare total DOUBLE;
select Total into total from core_cart where CartID = NEW.CartID;
END $$
DELIMITER ;
mysql
triggers
mysql-workbench
0 Answers
Your Answer