PL/SQL Trigger 7 – After Insert Trigger Example

Create an AFTER trigger, which is triggered after updating values of bsal and allw.The trigger should update the TSAL with the latest values of bsal and allw.

Answer

CREATE OR REPLACE TRIGGER au_empp
AFTER UPDATE ON EMPPP_a5518 FOR EACH ROW
declare
    tot number(5);
BEGIN
    
    :OLD.TSAL:=:OLD.BSAL + :OLD.ALLW;
    –:NEW.TSAL:=:NEW.BSAL + :NEW.ALLW;
    
END au_empp;
/

 

update EMPPP_a5518 set BSAL=68, ALLW=200;



 

You can leave a response, or trackback from your own site.

Leave a Reply