Bonjour,
je me relance dans les trigger mais j'ai une erreur de syntaxe dans phpmyadmin.
J'ai une table lang et une table tag, quand j'insère un nouveau tag je voudrai que ca insère dans une troisième table le tag associé à toutes les langues.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 CREATE TRIGGER tag_managment AFTER INSERT ON capliste.tag FOR EACH ROW BEGIN DECLARE C_LANG CURSOR for select idlang from capliste.lang; open C_LANG For Cur IN C_LANG Loop INSERT INTO langtag (idlang,idtag) VALUES(Cur,new.idtag) End loop ; END
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 MySQL a répondu: #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 'for select idlang from capliste.lang' at line 4
Partager