SQL Language (MOSC)

MOSC Banner

how do I add an extra where/when clause to a trigger

edited Dec 30, 2014 10:48AM in SQL Language (MOSC) 2 commentsAnswered ✓

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

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center