我尝试创建SQLite
触发器,每当玩家达到FlagPayment
点时自动将字段1
设置为10
,但是,显然,我有语法错误。
CREATE TRIGGER aft_update AFTER UPDATE ON Player
FOR EACH ROW WHEN (NEW.ParticipationPoints % 10 = 0) and (NEW.ParticipationPoints > 0)
BEGIN
UPDATE Player SET FlagPayment = 1 WHERE ID = NEW.ID
END;
这是结果:
near" END":语法错误:在更新后创建TRIGGER aft_update 每个行的玩家(NEW.ParticipationPoints%10 = 0)和 (NEW.ParticipationPoints> 0)BEGIN UPDATE播放器SET FlagPayment = 1 WHERE ID = NEW.ID END