CREATE OR REPLACE TRIGGER GRANT_COMMISSION
AFTER UPDATE OF SHIPDATE ON ORD
FOR EACH ROW
DECLARE
emp_nr number;
BEGIN
    SELECT empno INTO emp_nr FROM customer c, emp e
    WHERE :new.custid=c.custid
    AND e.empno=c.repid;
    UPDATE emp SET comm=comm+:new.total*4/100 WHERE empno=emp_nr;
END;
/
