title: Error Trigger : Table is mutating, trigger/function may not see it
body: <p>I wrote this trigger</p>
  
  <pre><code>CREATE OR REPLACE TRIGGER update_expirationDate
  AFTER INSERT ON DIFFUSION FOR EACH ROW
  DECLARE
      lastdiffusion DATE;
  BEGIN
      SELECT MAX(diffusionDate) INTO lastdiffusion FROM DIFFUSION WHERE idEpisode = :NEW.idEpisode;
      UPDATE EPISODE SET expirationDate = lastdiffusion + 14 WHERE idEpisode = :NEW.idEpisode;
  END;
  /
  </code></pre>
  
  <p>The compilation is OK, but when I insert some values in DIFFUSION, I have the following error :</p>
  
  <pre><code>ORA-04091: table DIFFUSION is mutating, trigger/function may not see it
  </code></pre>
  
  <p>I don't see what is the problem..</p>
  
  <p>Can someone help me and tell me what i am doing wrong ? Thanks.</p>