title: Mutating table error, even after compound trigger
body: <p>In order to solve the mutating table error, I followed <a href="http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/triggers.htm#LNPLS2005" rel="nofollow">http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/triggers.htm#LNPLS2005</a>, but still it isn't working. Can some help to identify where is the problem of the following trigger? </p>
  
  <p>Thanks,</p>
  
  <pre><code>CREATE OR REPLACE TRIGGER trg_d_inq_2 FOR
  UPDATE OF hu1_dimension_lvl1
  ON d_inq_dimensions
  COMPOUND TRIGGER
  v_exists_d NUMBER;
  v_exists_c NUMBER;
  
  TYPE process_t IS TABLE OF d_inq_dimensions.dimension_value%TYPE;
  
  process process_t;
  
  TYPE process_pvoc_t IS TABLE OF NUMBER
      INDEX BY VARCHAR2(100 BYTE);
  
  process_pvoc process_pvoc_t;
  
  TYPE nprocessvoc_t IS TABLE OF NUMBER;
  
  nprocessvoc nprocessvoc_t;
  BEFORE EACH ROW
  IS
  BEGIN
      SELECT a.hu1_dimension_lvl1, COUNT(a.hu1_dimension_lvl1)
        BULK COLLECT INTO process, nprocessvoc
        FROM d_inq_dimensions a
       WHERE a.dimension_name = 'Processo'
      GROUP BY a.hu1_dimension_lvl1;
  
      FOR j IN 1 .. process.COUNT
      LOOP
          process_pvoc(process(j)) := nprocessvoc(j);
      END LOOP;
  END
  BEFORE EACH ROW;
  
  AFTER EACH ROW
  IS
  BEGIN
      IF :new.hu1_dimension_lvl1 IS NOT NULL AND
         :new.dimension_name = 'Processo'
      THEN
          IF process_pvoc(:old.hu1_dimension_lvl1) IS NULL
          THEN
              DELETE external.c_parameters
               WHERE proj_id = 79 AND
                     ind_id = 53 AND
                     lvl_2 = :old.hu1_dimension_lvl1;
          END IF;
  
          SELECT COUNT(1)
            INTO v_exists_c
            FROM external.c_parameters a
           WHERE proj_id = 79 AND
                 ind_id = 53 AND
                 lvl_2 = :new.hu1_dimension_lvl1;
  
          IF v_exists_c = 0
          THEN
              INSERT INTO external.c_parameters
              /*and something more*/
          END IF;
      END IF;
  END
  AFTER EACH ROW;
  
  END;
  </code></pre>