title: Trigger to prevent Any Deleting from Table
body: <p>a trigger for this new rental history table that prevents deletions from the table.</p>
  
  <pre><code>CREATE OR REPLACE  TRIGGER RENTALHIS_DEL
  BEFORE DELETE ON RENTALHISTORY
  BEGIN
  dbms_output.put_line( 'Records can not be deleted');
  END;
  
  DELETE FROM RENTALHISTORY WHERE RENTALID = 1;
  
  
  
  -- It is deleting before it says it can not delete
  
  1 rows deleted.
  
  Records can not be deleted
  </code></pre>