I have two tables one is a table from a new system and the other is from a legacy system. When a product description changes in either the old or new table I need Oracle to update the other table.
I created a trigger in both tables to do this, but if the legacy table updates the new table, the new table trigger fires to update the legacy table and I get a mutating trigger error…
Is there a way to do this?
CREATE OR REPLACE TRIGGER New_Product_Updt
AFTER UPDATE OF Product_Desc ON Inventory
REFERENCING NEW AS new_Prod OLD AS Old_Prod
FOR EACH ROW
BEGIN
UPDATE NEW_Product
SET Product_Desc = :new_Prod.Product_Desc
WHERE Product_Desc = :Old_Prod.Product_Desc
END;
I created a trigger in both tables to do this, but if the legacy table updates the new table, the new table trigger fires to update the legacy table and I get a mutating trigger error…
Is there a way to do this?
CREATE OR REPLACE TRIGGER New_Product_Updt
AFTER UPDATE OF Product_Desc ON Inventory
REFERENCING NEW AS new_Prod OLD AS Old_Prod
FOR EACH ROW
BEGIN
UPDATE NEW_Product
SET Product_Desc = :new_Prod.Product_Desc
WHERE Product_Desc = :Old_Prod.Product_Desc
END;