title: Select into statement in a trigger
body: <p>I am using oracle SQL and have two tables, lets just call them TriggerTest1 and TriggerTest2 , with the fields ID, NAME, FROM, UNTIL, where FROM and UNTIL are dates.</p>
  
  <p>I have written this trigger: </p>
  
  <pre><code>CREATE OR REPLACE TRIGGER a 
  BEFORE INSERT ON TRIGGERTEST1
  DECLARE
      oldentry TRIGGERTEST1%rowtype;
  BEGIN 
      IF EXISTS(SELECT * INTO oldentry FROM TRIGGERTEST1 a WHERE a.ID = New.ID) THEN 
          INSERT INTO TRIGGERTEST2 
          VALUES(oldEntry.NAME, oldEntry.FROM, New.FROM, oldEntry.ID);
          DELETE FROM TRIGGERTEST1 b WHERE b.ID = new.ID;
      END IF;
  END;
  </code></pre>
  
  <p>Basically this should just move an entry in Triggertest1 to Triggertest2 when I try to insert an already existing ID into Triggertest1.</p>
  
  <p>I get this error:</p>
  
  <pre><code>Error(3,21): PLS-00103: Encountered the symbol "INTO" when expecting one of the following:     from  
  </code></pre>
  
  <p>According to <a href="http://www.dba-oracle.com/t_pl_sql_plsql_select_into_clause.htm" rel="nofollow noreferrer">this</a> my SELECT INTO statement should be correct, does anyone know what the problem is?</p>