how do I add an extra where/when clause to a trigger
So I have the classic parent (product) child ( product_item ) table relationship.
The Order table contains a field (order_total) which is supposed to represent the sum of price * quantity for each row in the Order Item table. What I want to do is update the order_total on the Order table each time the user changes the quantity or price for a row in the Order Item table.
This trigger works ….
CREATE OR REPLACE TRIGGER "FOD"."ORDER_TOTAL_UPDATE"
after insert or delete or update of line_item_id,product_id,quantity,unit_price,created_by,creation_date,last_updated_by,last_update_date,object_version_id on order_items