title: Oracle trigger invalid
body: <p>I'm new to SQL and I'm trying to create a trigger that would insert into an audit table. </p>
  
  <pre><code>create or replace trigger late_ship_insert
    after insert on suborder
    for each row
  declare
    employee int;
  begin
    select emp_id 
      into employee
      from handles
     where order_no = :new.order_no;
    if :new.actual_ship_date &gt; :new.req_ship_date then
      insert into ship_audit
        values (employee, :new.order_no, :new.suborder_no, :new.req_ship_date, :new.actual_ship_date);
  end;
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Warning: execution completed with warning
  trigger late_ship_insert Compiled.
  </code></pre>
  
  <p>But once I try an insert statement it tell me the trigger is not working it to drop it.</p>
  
  <pre><code>Error starting at line 1 in command:
  insert into suborder 
      values  ( 8, 3, '10-jun-2012', '12-jul-2012', 'CVS', 3) 
  Error at Command Line:1 Column:12
  Error report:
  SQL Error: ORA-04098: trigger 'COMPANY.LATE_SHIP_INSERT' is invalid and failed re-validation
  04098. 00000 -  "trigger '%s.%s' is invalid and failed re-validation"
  *Cause:    A trigger was attempted to be retrieved for execution and was
             found to be invalid.  This also means that compilation/authorization
             failed for the trigger.
  *Action:   Options are to resolve the compilation/authorization errors,
             disable the trigger, or drop the trigger.
  </code></pre>
  
  <p>Any idea what is causing this, any help would be greatly appreciated. Thanks!</p>