日期:2014-05-16  浏览次数:20764 次

请高手帮忙看下这个触发器 哪里写错了
数据库编码utf-8,数据库引擎myisam
sql:
SQL code

create trigger trg1
After insert on idi
For each row
Begin
update uk set kucun = kucun-new.num where iid = new.id;
End



报错代码:

SQL code

错误
SQL 查询: 

CREATE trigger trg1 AFTER INSERT ON idi
FOR each
ROW 
BEGIN 
UPDATE uk SET kucun = kucun - new.num WHERE iid = new.id;



MySQL 返回: 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5 






------解决方案--------------------
10后面少个";"