Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create or replace TRIGGER update_salary
- BEFORE UPDATE OF salaire_actuel ON professeurs FOR EACH ROW
- DECLARE
- TOO_MUCH EXCEPTION;
- BEGIN
- DBMS_OUTPUT.PUT_LINE((:OLD.salaire_actuel * 0.2 + :OLD.salaire_actuel) || :NEW.salaire_actuel || USER);
- IF((:OLD.salaire_actuel * 0.2 + :OLD.salaire_actuel) < :NEW.salaire_actuel AND USER <> 'GRANDCHEF') THEN
- RAISE TOO_MUCH;
- END IF;
- EXCEPTION
- WHEN TOO_MUCH THEN
- RAISE_APPLICATION_ERROR (-20002, 'No modification is authorized');
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement