title: How to get table fields from which was called a trigger with Oracle 10g?
body: <p>I want to calculate the average of values ​​in a column of my table (PRA_COEFF) (RAPPORT_VISITE) for a field (PRA_NUM) given, when I add or change a row of it. Then I want to save this value in another table (PRACTITIONER) to the row where PRA_NUM worth PRA_NUM given above. </p>
  
  <pre><code>CREATE TABLE "RAPPORT_VISITE" 
  (
  "RAP_NUM" NUMBER (10,0), 
  "PRA_NUM" NUMBER (10,0), 
  "PRA_COEFF" NUMBER (10,0), 
  ) 
  
  CREATE TABLE "PRATICIEN" 
  (
  "PRA_NUM" NUMBER (10,0), 
  "PRA_COEFCONF" NUMBER 
  ) 
  </code></pre>
  
  <p>The trigger is called when adding or Modification RAPPORT_VISITE the table. I tried like this, but I can not retrieve the row affected by the trigger, and thus PRA_NUM, that I need to read.</p>
  
  <pre><code>create or replace TRIGGER UDPATE_PRAT_COEFCONF
    AFTER INSERT or UPDATE ON RAPPORT_VISITE
  
    DECLARE
    somme NUMBER;
    nb NUMBER;
    moyenne NUMBER;
    rapport NUMBER;
    pra_id NUMBER;
  
  BEGIN
  
    /*SELECT MAX(RAP_NUM) INTO rapport FROM RAPPORT_VISITE; // Not want I need in case where I modify a row... */
    SELECT PRA_NUM INTO pra_id FROM RAPPORT_VISITE WHERE RAP_NUM=rapport;
    SELECT SUM(PRA_COEFF) INTO somme FROM RAPPORT_VISITE WHERE PRA_NUM=pra_id;
    SELECT COUNT(*) INTO nb FROM RAPPORT_VISITE WHERE PRA_NUM=pra_id;
  
    IF (nb != 0) THEN
      moyenne := somme/nb;
      moyenne := TRUNC (moyenne,1);
      UPDATE PRATICIEN SET PRA_COEFCONF=moyenne WHERE PRA_NUM=pra_id;
    END IF;
  
  END;
  </code></pre>