Bonjour,
j'ai un problème avec la syntaxe de mes trigger.
Mon trigger est accepté comme ceci par le moteur mysql
et quand je l'introduit comme ceci il n'en veut pas, quelqu'un peut m'aider
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 CREATE TRIGGER `trigger_update_searchText` AFTER UPDATE ON `annonce` FOR EACH ROW UPDATE search_text SET data=CONCAT_WS(' ',NEW.Sujet,NEW.SujetNL,NEW.Contenu,NEW.ContenuNL),Actif=NEW.Actif,DateUpdated=NOW() WHERE model = 'annonce' and Ref_Model = NEW.Ref
Et j'ai essayé pas mal de combinaison, pas moyen...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 CREATE TRIGGER `trigger_update_searchText` AFTER UPDATE ON `annonce` FOR EACH ROW BEGIN IF NEW.hit = OLD.hit THEN UPDATE search_text SET data=CONCAT_WS(' ',NEW.Sujet,NEW.SujetNL,NEW.Contenu,NEW.ContenuNL),Actif=NEW.Actif,DateUpdated=NOW() WHERE model = 'annonce' and Ref_Model = NEW.Ref; END IF; END;
Merci d'avance
Partager