Bonjour,
Je fais un trigger sous oracle 10g. Je veux modifier un champ d'une table lorsque qu'un autre champ de cette table est modifiée. J'ai déjà lu que c'était possible sur le principe. Voici mon trigger :J'ai l'erreur suivante en testant mon trigger :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 SQL> create or replace trigger trigger_radio_navaid_kind 2 before update of radio_navaid_kind on geo_pt 3 for each row when (old.radio_navaid_kind is null) 4 begin 5 if :new.radio_navaid_kind = 'VOR' 6 then 7 update geo_pt set aixm_equip1_identifier = sys_guid(); 8 end if; 9 end; 10 / Trigger created.Ma table geo_pt est définie ainsi :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 SQL> update geo_pt set radio_navaid_kind='VOR' where point_name='ABADO'; update geo_pt set radio_navaid_kind='VOR' where point_name='ABADO' * ERROR at line 1: ORA-04091: table OPS$OPE.GEO_PT is mutating, trigger/function may not see it ORA-06512: at "OPS$OPE.TRIGGER_RADIO_NAVAID_KIND", line 4 ORA-04088: error during execution of trigger 'OPS$OPE.TRIGGER_RADIO_NAVAID_KIND'Merci de votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 SQL> desc geo_pt Name Null? Type ----------------------------------------- -------- ---------------------------- POINT_NAME NOT NULL VARCHAR2(5) RADIO_NAVAID_KIND VARCHAR2(16) AIXM_EQUIP1_IDENTIFIER VARCHAR2(36) SQL>
Partager