-4
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
4

1 回答 1

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 ;

如果您没有定义另一个分隔符,;那么您的语句将在第一个结束;并且它将是不完整的。

于 2013-04-30T11:40:51.387 回答