title: trigger to stop the execution of SQl query
body: <pre><code>CREATE OR REPLACE trigger million_trigger
  BEFORE INSERT or UPDATE on employee
  FOR EACH ROW
  WHEN (new.SALARY&gt;1000000)
  
  DECLARE
  txt EXCEPTION;
  
  BEGIN
  if INSERTING or UPDATING then 
  
      RAISE txt ;
  
  end if;
  
  EXCEPTION
      WHEN txt THEN
          DBMS_OUTPUT.PUT_LINE('SALARY TOO HIGH');
  end;
  /
  </code></pre>
  
  <p>Hello, I created a trigger which is checks if the salary from table employee is greater than 1,000,000. If the salary is greater, then the trigger is supposed to stop the execution of an insert statement from a stored procedure. The trigger has been successfully created but when I insert a record with salary > 1,000,000 nothing happens. ( the record gets inserted - which is not supposed to happen ) Any idea?</p>