Bonjour.
g une BD de gestion de carburant avec 4 tables
camion(id,numero,chauffeur)
carburant(id,consommation,date,id_camion)
cuve(id,index,sortie,date)
consommation(id,id_camion,carb_conso,carb_sortie,id_cuve)
maintenant je veux creer un trigger qui, apres insertion de consommation dans la table carburant, met a jour la table cuve en ajoutant cette valeur a l'index.
jais essaye ceci:
jai l'erreur suivante: Erreur de syntaxe près de 'index=new.index+new.consommation where id_cuve=new.id_cuve;
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 CREATE TRIGGER apres_servir_camion AFTER INSERT ON carburant FOR EACH ROW BEGIN UPDATE cuve SET index=new.index+new.consommation where id_cuve=new.id_cuve; END$$ DELIMITER ;
END'.
Merci de m'aider
Partager