(Database) How do I rewrite this trigger code to be a row level trigger? after writing, test the code by inserting a new row. CREATE OR REPLACE TRIGGER UPDATE_ORDERS AFTER INSERT OR UPDATE OF Units,...


(Database)


How do I rewrite this trigger code to be a row level trigger? after writing, test the code by inserting a new row.


CREATE OR REPLACE TRIGGER UPDATE_ORDERS


AFTER INSERT OR UPDATE OF Units, Price ON ORDERS


FOR EACH ROW


BEGIN


UPDATE ORDERS


SET new.Total = Units*Price;


END;




*For reference, this is the code for the orders table:


CREATE TABLE ORDERS(


ORDERNO INTEGER PRIMARY KEY,


PRODUCT VARCHAR(20),


UNITS INTEGER,


PRICE NUMBER, TOTAL NUMBER);



Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here