Hi guys I intend to create a Trigger for MySQL table so that after Values are Inserted into the table, the Column exp_sales is set to qnty_received value *selling_price but I am getting this error:
ERROR 1193 (HY000): Unknown system variable ‘exp_sales’
This is My Query:
delimiter $$
Create trigger tsales after insert on Store_info_table
for each row
set exp_sales = qnty_received * selling_price;
END$$
What is the problem and what is the best way to create the trigger so that after teh Quantity and selling Price is Inserted, the field for exp_sales(Total) is Updated with the right value?
If I understood you right you want to update a field of your record after insert. Try