mysql 触发器的问题 Can't update table 'tbl' in stored function/trigger because it is already used by state
2017-03-15 17:48
591 查看
原文:http://blog.csdn.net/java2000_net/article/details/3857579
如果你在触发器里面对刚刚插入的数据进行了 insert/update, 则出现这个问题。因为会造成循环的调用.
create trigger test
before update on test
for each row
update test set NEW.updateTime = NOW() where id=NEW.ID;
END
应该使用set操作,而不是在触发器里使用 update,比如
create trigger test
before update on test
for each row
set NEW.updateTime = NOW();
END
如果你在触发器里面对刚刚插入的数据进行了 insert/update, 则出现这个问题。因为会造成循环的调用.
create trigger test
before update on test
for each row
update test set NEW.updateTime = NOW() where id=NEW.ID;
END
应该使用set操作,而不是在触发器里使用 update,比如
create trigger test
before update on test
for each row
set NEW.updateTime = NOW();
END
相关文章推荐
- MySQL触发器更新本表数据异常:Can’t update table ‘tbl’ in stored function/trigger because it is already used by s
- Can't update table 'tbl' in stored function/trigger because it is already used by statement which invoked this stored function/t
- mysql -- error code [1442]; Can't update table 'table_name' in stored function/trigger because it is already used by statement w
- Can't update table 'psxt_user' in stored function/trigger because it is already used by statement wh
- Solution for Can’t update table ‘t1′ in stored function/trigger because it is already used by statement which invoked this store
- mysql创建触发器错误提示:Can not update in stored function/trigger already used by statement invoked
- MySQL触发器更新本表数据异常:Can't update table 'tbl' in stored function/trigger because it is already used by statement which invoked this
- ERROR 1442 (HY000): Can\'t update table \'sign\' in stored function/trigger because it is already used by statement which invoke
- Can't update table 'test_trigger' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
- 触发器在插入时更新此条新记录 错误it is already used by statement which invoked this stored functiontrigger的解决方法
- 错误it is already used by statement which invoked this stored functiontrigger的解决方法
- ERROR 1442 (HY000):because it is already used by statement which invoked this stored function/tr
- MySQL触发器更新本表数据异常:Can't update table 'tbl' in stored function/trigger because it
- mysql触发器报错 1422 Explicit or implicit commit is not allowed in stored function or trigger.
- mysql中的一个特殊问题:You can’t specify target table ‘abc’ for update in FROM clause
- 创建触发器后不能进行修改操作,Can't update table 'psxt_user' in stored function/trigger because
- Can't perform Create, Update or Delete operations on 'Table(@TableName)' because it is read-only.
- mysql update语句问题:You can't specify target table 'user' for update in FROM clause
- ios The Simulator can't be launched because it is already in use.
- OUI-10022:The target area /oracle/oraInventory cannot be used because it is in an invalid state.