SHARE
TWEET

Untitled

a guest Feb 25th, 2020 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create or replace TRIGGER update_salary
  2. BEFORE UPDATE OF salaire_actuel ON professeurs FOR EACH ROW
  3.  
  4.  
  5. DECLARE
  6. TOO_MUCH EXCEPTION;
  7.  
  8. BEGIN
  9.     DBMS_OUTPUT.PUT_LINE((:OLD.salaire_actuel * 0.2 + :OLD.salaire_actuel) || :NEW.salaire_actuel || USER);
  10.     IF((:OLD.salaire_actuel * 0.2 + :OLD.salaire_actuel) < :NEW.salaire_actuel AND USER <> 'GRANDCHEF') THEN
  11.     RAISE TOO_MUCH;
  12.     END IF;
  13. EXCEPTION
  14.     WHEN TOO_MUCH THEN
  15.     RAISE_APPLICATION_ERROR (-20002, 'No modification is authorized');
  16. END;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top