Erreur oracle "table mutante"
Nanis29
Messages postés
61
Date d'inscription
Statut
Membre
Dernière intervention
-
chuka Messages postés 965 Date d'inscription Statut Membre Dernière intervention -
chuka Messages postés 965 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Alors voila j'explique brievement
j'ai un trigger à faire sur oracle (concerne une compagnie aérienne, le but et de vérifier la cohérences des dates et heures des vols lors d'une création)
voila mon trigger :
create or replace
TRIGGER TABLE_VOL BEFORE INSERT ON VOL for each row
declare
Date_Depart VOL.datdepVo%type;
Date_Arrivee VOL.datarVol%type;
Heure_Depart VOL.hedepVol%type;
Heure_Arrivee VOL.hearrVol%type;
BEGIN
select datdepVo into Date_Depart from VOL where numerVol=:new.numerVol;
select datarVol into Date_Arrivee from VOL where numerVol=:new.numerVol;
select hedepVol into Heure_Depart from VOL where numerVol=:new.numerVol;
select hearrVol into Heure_Arrivee from VOL where numerVol=:new.numerVol;
if to_number(to_char(Date_Depart)) > to_number(to_char(Date_Arrivee)) then
raise_application_error(-20110,'Dates incohérentes');
else
if to_number(to_char(Date_Depart)) = to_number(to_char(Date_Arrivee)) then
if to_number(to_char(Heure_Depart)) > to_number(to_char(Heure_Arrivee)) then
raise_application_error(-20120,'Heures incohérentes');
end if;
end if;
end if;
END;
Mon problèe c'est que forcement il me dit table mutante lorsque j'essayer de faire un INSERT dans la table vol.
Mais je n'arrive pas à le contourner car c'set la seule table ou je peux chopper ces informations la :/
Alors voila j'explique brievement
j'ai un trigger à faire sur oracle (concerne une compagnie aérienne, le but et de vérifier la cohérences des dates et heures des vols lors d'une création)
voila mon trigger :
create or replace
TRIGGER TABLE_VOL BEFORE INSERT ON VOL for each row
declare
Date_Depart VOL.datdepVo%type;
Date_Arrivee VOL.datarVol%type;
Heure_Depart VOL.hedepVol%type;
Heure_Arrivee VOL.hearrVol%type;
BEGIN
select datdepVo into Date_Depart from VOL where numerVol=:new.numerVol;
select datarVol into Date_Arrivee from VOL where numerVol=:new.numerVol;
select hedepVol into Heure_Depart from VOL where numerVol=:new.numerVol;
select hearrVol into Heure_Arrivee from VOL where numerVol=:new.numerVol;
if to_number(to_char(Date_Depart)) > to_number(to_char(Date_Arrivee)) then
raise_application_error(-20110,'Dates incohérentes');
else
if to_number(to_char(Date_Depart)) = to_number(to_char(Date_Arrivee)) then
if to_number(to_char(Heure_Depart)) > to_number(to_char(Heure_Arrivee)) then
raise_application_error(-20120,'Heures incohérentes');
end if;
end if;
end if;
END;
Mon problèe c'est que forcement il me dit table mutante lorsque j'essayer de faire un INSERT dans la table vol.
Mais je n'arrive pas à le contourner car c'set la seule table ou je peux chopper ces informations la :/
A voir également:
- Erreur oracle "table mutante"
- Table ascii - Guide
- Table des matières word - Guide
- Table des caractères - Guide
- Table des annexes word ✓ - Forum Word
- Datediff oracle ✓ - Forum Oracle