無法創建觸發器
數據庫Server: MYSQL
數據庫Server前端:HeidiSQL
觸發器代碼:
SQL code
create trigger KEYIN_AU
after insert
on keyin_info
for EACH ROW
BEGIN
insert into keyout_info(KEYINNO,Serial_NO)values( NEW.KEYINID,NEW.Serial_NO)
END
錯誤提示:
SQL Error (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 'END' at line 7
但是我比對了網上的一些代碼,感覺沒有啥問題啊。嘗試在insert語句和END後面分別加分號(delimiter是分號),也沒有效果。
------解决方案--------------------create trigger KEYIN_AU
after insert
on keyin_info
for EACH ROW
insert into keyout_info(KEYINNO,Serial_NO)values( NEW.KEYINID,NEW.Serial_NO) ;
------解决方案--------------------create trigger KEYIN_AU
after insert
on keyin_info
for EACH ROW
BEGIN
insert into keyout_info(KEYINNO,Serial_NO)values( NEW.KEYINID,NEW.Serial_NO);
END
少个;