j'essaye de créer un trigger et voici le message d'erreur
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER //
CREATE TRIGGER tgr_ins_desc_inter
AFTER INSERT ON t_desc_inter
F' at line 1
Merci de votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 DELIMITER // CREATE TRIGGER tgr_ins_desc_inter AFTER INSERT ON t_desc_inter FOR EACH ROW BEGIN SET @tps_total = 0; SET @result=SELECT tps_desc_inter as tps FROM t_desc_inter WHERE id_desc_inter=NEW.id_intervention; WHILE (@row=mysql_fetch_row(@result)) { @tps_total=@tps_total+@row[0]; } UPDATE t_intervention SET tps_inter=@tps_total WHERE id_intervention=NEW.id_intervention; END// DELIMITER ;
Partager