Information Systems



Trigger example in Mysql

delimiter //
CREATE TRIGGER update_header after UPDATE ON invoice_lines
FOR EACH ROW
BEGIN
update invoice_head set total = (total + new.amount) where invoice_head.id = new.header_id;
END;//
delimiter ;