Hello everyone,
I'm trying to update a value in a table after fires a trigger on another table.
I have a table with orders (where are founded data like ordernumber, etc);
I have a table with ordersproducts (where have informations about each product in this order, like: productid, amount, unitprice, etc)
My trigger is BEFORE INSERT OR UPDATE; FOR EACH ROW; and fires on ORDERSPRODUCTS table.
I wish my trigger SUM all "amount" fileds from ORDERPRODUCTS and insert it in ORDERS table.
I should do it using FOR EACH STATEMENT instead ROW?
Thanks all and sorry for my english!