資訊如下 ERROR 1442 (HY000): Can"t update table "event1" in stored function/trigger becau
se it is already used by statement which invoked this stored function/trigger。
剛開始觸發器定義如下
create trigger event_trigger BEFORE INSERT ON event1
FOR EACH ROW UPDATE event1
SET NEW。event_time =CURRENT_TIMESTAMP();
一般在定義觸發器時 如果對本表做更新 應寫成如下
drop trigger if exists event_trigger ;
DELIMITER |
FOR EACH ROW
SET NEW。
event_time =CURRENT_TIMESTAMP();
|
DELIMITER ;
不用寫成全域性的update 表名。
資訊如下 ERROR 1442 (HY000): Can"t update table "event1" in stored function/trigger becau
se it is already used by statement which invoked this stored function/trigger。
剛開始觸發器定義如下
create trigger event_trigger BEFORE INSERT ON event1
FOR EACH ROW UPDATE event1
SET NEW。event_time =CURRENT_TIMESTAMP();
一般在定義觸發器時 如果對本表做更新 應寫成如下
drop trigger if exists event_trigger ;
DELIMITER |
create trigger event_trigger BEFORE INSERT ON event1
FOR EACH ROW
SET NEW。
event_time =CURRENT_TIMESTAMP();
|
DELIMITER ;
不用寫成全域性的update 表名。