title: How to raise an Exception inside a Trigger? Is there a way to do this?
body: <p>There's a situation like: If the Salary column in updated with a value lesser than it's original value, print an error message and let the update NOT happen. This is what I've written so far:</p>
  
  <pre><code>CREATE OR REPLACE TRIGGER TRIG1
  BEFORE UPDATE OF SAL ON EMP
  for each row
    USER_XCEP EXCEPTION
    WHEN (NEW.SAL&lt;OLD.SAL)
  BEGIN
    RAISE USER_XCEP
  
  EXCEPTION
    WHEN USER_XCEP THEN
         DBMS_OUTPUT.PUT_LINE('UPDATION NOT ALLOWED - ILLEGAL VALUES');
  END;
  </code></pre>
  
  <p>And I get the error - Incorrect Trigger Specification</p>
  
  <p>Is there any other way to achieve this? </p>