aide creation trigger sous mysql
bonjour a tous;
mon probleme c'est que j'ai pas pu creer le trigger suivant:
Code:
1 2 3 4 5 6 7 8 9
| CREATE TRIGGER upd_check BEFORE UPDATE ON compte
FOR EACH ROW
BEGIN
IF NEW.solde < 10 THEN
SET NEW.solde = 0;
ELSEIF NEW.solde > 100 THEN
SET NEW.solde = 100;
END IF;
END |
ca me genere cette erreur:
Citation:
"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 'TRIGGER upd_check BEFORE UPDATE ON compte
FOR EACH ROW
BEGIN
' at line 1"
j'utilise mySql Server 4.1