title: Oracle Trigger ORA-04098: trigger is invalid and failed re-validation
body: <p>I am trying to create a simple trigger in an oracle 10g database. This script to Create the trigger runs clean.</p>
  
  <pre><code>CREATE OR REPLACE TRIGGER newAlert
  AFTER INSERT OR UPDATE ON Alerts
    BEGIN
          INSERT INTO Users (userID, firstName, lastName, password) VALUES ('how', 'im', 'testing', 'this trigger')
    END;           
  /
  </code></pre>
  
  <p>But when I run:</p>
  
  <pre><code>INSERT INTO Alerts(observationID, dateSent, message, dateViewed) VALUES (3, CURRENT_TIMESTAMP, 'Alert: You have exceeded the Max Threshold', NULL);
  </code></pre>
  
  <p>to activate the trigger, I get this error message:</p>
  
  <blockquote>
    <p>ORA-04098: trigger 'JMD.NEWALERT' is invalid and failed re-validation
    (0 rows affected)</p>
  </blockquote>
  
  <p>I don't understand whats causes this error. Do you know what causes this error? Or why this is happening?</p>
  
  <p>Thank you in advance!</p>
  
  <p>-David</p>