Zkuste toto:
CREATE TRIGGER check_trigger
BEFORE INSERT
ON table
FOR EACH ROW
BEGIN
IF NEW.age<0 OR NEW.age>50 THEN
CALL `Error: Wrong values for age`; -- this trick will throw an error
END IF;
END
Zkuste toto:
CREATE TRIGGER check_trigger
BEFORE INSERT
ON table
FOR EACH ROW
BEGIN
IF NEW.age<0 OR NEW.age>50 THEN
CALL `Error: Wrong values for age`; -- this trick will throw an error
END IF;
END