Question: Does this look right? if not, what changes are needed to be made? Q: Modify the trigger in Assignment 9-2 as needed. Add code to

Does this look right? if not, what changes are needed to be made?

Q: Modify the trigger in Assignment 9-2 as needed. Add code to check whether the DTRECD column already has a date in it and is now being set to NULL.

A: CREATE OR REPLACE TRIGGER bb_reqfill_trg

AFTER UPDATE OF dtrecd ON bb_product_request

FOR EACH ROW

BEGIN IF :OLD.dtrecd IS NULL THEN

UPDATE bb_product

SET

stock = stock + :NEW.qty

WHERE idProduct = :NEW.idProduct;

END IF;

END;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!