title: Oracle trigger which doesn't work
body: <p>I've create a trigger which work on 2 tables like this:
  - when insert a new row on table A (GEDDFILES) then a number field on table B(GEDDIRS) will be increased.</p>
  
  <p>Code is getting compiled without errors but it doesn't work. the code is bellow:</p>
  
  <pre><code>CREATE OR REPLACE TRIGGER "A"."TRGMAJNRFIC" AFTER
  INSERT ON "A"."GEDFILES" FOR EACH ROW DECLARE 
   wtmpnrfic number;
  
  BEGIN 
   SELECT MAX(OBJNRFICHIERS) INTO wtmpnrfic from GEDDirs WHERE ID= :new.ID;
   UPDATE GEDDirs SET OBJNRFICHIERS = wtmpnrfic+1 WHERE ID=:new.id;
  END;
  </code></pre>
  
  <p>Tables are normalized and PK from GEDDIRS(field ID) is FK in table GEDFILES (field ID)</p>
  
  <p>I can't figure out where is the problem, even is a little one.</p>
  
  <p>The field OBJNRFICHIERS from table GEDFILES is null. Can be this a problem when i'm trying to increase it's value?</p>