This situation arises: if the "Salary" column is updated with a value less than its original value, print an error message and do NOT inform about it. This is what I wrote so far:
CREATE OR REPLACE TRIGGER TRIG1 BEFORE UPDATE OF SAL ON EMP for each row USER_XCEP EXCEPTION WHEN (NEW.SAL<OLD.SAL) BEGIN RAISE USER_XCEP EXCEPTION WHEN USER_XCEP THEN DBMS_OUTPUT.PUT_LINE('UPDATION NOT ALLOWED - ILLEGAL VALUES'); END;
And I get the error - Incorrect trigger specification
Is there any other way to achieve this?
source share