CREATE TRIGGER pointclosedtrigger AFTER UPDATE ON points
FOR EACH ROW BEGIN
IF NEW.is_open='3'
THEN
INSERT into point_history (idpoints,idmembers,action_time,action_type)
VALUES (OLD.idpoints,NEW.idmembers,NOW(),'2');
END IF;
END
答案 0 :(得分:0)
您忘了定义分隔符
delimiter |
CREATE TRIGGER `pointclosedtrigger` AFTER UPDATE ON `points`
FOR EACH ROW BEGIN
IF NEW.is_open='3'
THEN
INSERT into point_history (`idpoints`,`idmembers`,`action_time`,`action_type`)
VALUES (OLD.`idpoints`,NEW.`idmembers`,NOW(),'2');
END IF;
END
|
delimiter ;
如果您没有定义另一个分隔符而不是;
,那么您的陈述将在第一个;
结束,并且它将不完整。