title: How to check if time is greater or less than another time in PLSQL
body: <p>I am trying to check in my trigger if an inserted record is in the table <code>TUTPRAC</code> contains and <code>CLASSTIME &lt; '9AM' OR &gt; '6PM'</code>. If this is true then that record is updated with certain fields being changed to <code>NULL</code>.</p>
  
  <pre><code>CREATE TRIGGER CheckBeforeAfterHours
  BEFORE INSERT OR UPDATE OF CLASS_TIME ON TUTPRAC
  FOR EACH ROW
  BEGIN
    IF (:NEW.CLASS_TIME &lt; '09:00' OR &gt; '18:00') THEN
       :NEW.STAFFNO := NULL;
       :NEW.CLASS_DAY := NULL;
       :NEW.CLASS_TYPE := NULL;
       :NEW.ROOMNUM := NULL;
    END IF;
  END CheckBeforeAfterHours;
  </code></pre>
  
  <p><strong>Columns of <code>TUTPRAC</code> table:</strong></p>
  
  <pre><code>CLASSID (PK), UNITCODE, STAFFNO, CLASSDAY, CLASSTIME, CLASSTYPE, ROOMNUM
  </code></pre>
  
  <p>The field <code>CLASSTIME</code> is set to <code>varchar(5)</code>.</p>
  
  <p>I use <code>Oracle SQLDeveloper</code>.</p>
  
  <p><strong>PROBLEM</strong></p>
  
  <p>my issue is that i keep getting this error when i try to run the trigger:</p>
  
  <pre><code>Error(2,36):
  PLS-00103: Encountered the symbol "&gt;" when expecting one of the following:
      ( - + case mod new not null &lt;an identifier&gt; &lt;a double-quoted delimited-identifier&gt;
      &lt;a bind variable&gt; continue avg count current exists max min prior sql stddev
      sum variance execute forall merge time timestamp interval
      date &lt;a string literal with character set specification&gt;
      &lt;a number&gt; &lt;a single-quoted SQL string&gt; pipe
      &lt;an alternatively-quoted string literal with character set specification&gt;
      &lt;an alternatively
  </code></pre>