Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How update a table after fires a trigger in another table?

2767422Oct 3 2014 — edited Oct 3 2014

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!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2014
Added on Oct 3 2014
8 comments
4,261 views