title: Using Sysdate in trigger
body: <p>Hello guys I'm a bit of a noob when it comes to triggers so I'm just looking for some advice on how to do the follow trigger.</p>
  
  <p>I have created a trigger that will throw an error message if someone was to delete a record during office hours however I would like to create another trigger that uses SYSDATE will not delete records from say today and future dates. </p>
  
  <p>I was thinking of maybe using >=SYSDATE but I'm not sure if that is a valid sql statement.</p>
  
  <pre><code>CREATE OR REPLACE TRIGGER records_delete 
  BEFORE DELETE 
  ON RECORDS FOR EACH ROW 
  BEGIN 
      IF TO_CHAR(SYSDATE, 'HH24MI') NOT &gt;= sysdat 
         RAISE_APPLICATION_ERROR(-20669, 'You can not delete current or future records'); 
      END IF; 
  END records_delete;
  </code></pre>
  
  <p>Thanks, leprejohn </p>