Bonjour,
J'ai un trigger qui doit se faire avant une insertion, en il doit en quelque sorte m'autoriser ou non la requete insert.
voici mon trigger:
Or il me sort :Code:
1
2
3
4
5
6
7
8
9 CREATE TRIGGER test BEFORE INSERT ON prendre FOR EACH ROW BEGIN DECLARE nb INTEGER; SET nb = (SELECT COUNT(*) FROM reserver WHERE IDPERS = NEW.IDPERS AND IDREPAS = NEW.IDREPAS); IF nb = 0 THEN ROLLBACK; END IF; END
Je comprend pas pourquoi?Citation:
#1422 - Explicit or implicit commit is not allowed in stored function or trigger.