Bonjour à tous,
je suis entrain de créé un trigger pour ma table messagearticle sous mysql qui à pour rôle d'empêcher l'insertion des lignes qui sont existent dans la table
pourrez vous m'aidez pour résoudre ce problème .
Merci
c'est le code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 delimiter // CREATE TRIGGER datasources.test BEFORE INSERT ON `datasources`.`messagearticle` FOR EACH ROW BEGIN DECLARE titre varchar(200); set titre= (select TITRE from datasources.messgearticle where NOM_AUTEUR =New.NOM_AUTEUR and TITRE =New.TITRE and date= New.DATE ) ; IF(titre is not null) THEN END IF; END; // delimiter ;
Partager