Statement Level Trigger
CREATE TRIGGER average-price-preserve
INSTEAD OF UPDATE OF price ON Product
REFERENCING
OLD_TABLE AS OldStuff
NEW_TABLE AS NewStuff
WHEN (1000 <
(SELECT AVG (price)
FROM ((Product EXCEPT OldStuff) UNION NewStuff))
DELETE FROM Product
WHERE (name, price, company) IN OldStuff;
INSERT INTO Product
(SELECT * FROM NewStuff)
Previous slide
Next slide
Back to first slide
View graphic version