title: Oracle trigger- instead of delete, update the row
body: <p>How do I write an Oracle trigger, than when a user deletes a certain record, the delete doesnt actually happen, but instead performs an update on those rows and sets the status of the record to 'D'?</p>
  
  <p>I tried:</p>
  
  <pre><code>create or replace
  trigger DELFOUR.T4M_ITEM_ONDELETE
  before delete on M_ITEM_H
  FOR EACH ROW
  BEGIN
    UPDATE
      M_ITEM_H
    SET
      ITEM_STAT = 'D'
    WHERE
      CUST_CODE = 'TEST'
      AND ITEM_CODE = 'GDAY'
    ;
  
    raise_application_error(-20000,'Cannot delete item');
  END;
  </code></pre>
  
  <p>But I am getting mutating table errors. Is this possible?</p>