problem trigger supprimer
Salut,
j'ai un trigger qui se chargera de supprimer les clefs etranger de l'élément supprimé.
Code:
1 2 3 4 5 6 7 8
|
DROP TRIGGER IF EXISTS `suppression`//
CREATE TRIGGER `suppression` BEFORE DELETE ON TABLE1
FOR EACH ROW BEGIN
delete from TABLE2 where ID=OLD.id and type=OLD.type;
delete from TABLE3 where ID=OLD.id and type=OLD.type;
delete from TABLE4 where ID=OLD.id and type=OLD.type;
END// |
mais j'ai un erreur :
Code:
1 2 3 4
|
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 '//
CREATE TRIGGER `suppression` BEFORE DELETE ON table1
FOR' at line 1 |
je ne peux pas utiliser la suppression en cascade
merci de votre aide