[Err] 1442 - Can't update table 'test_trigger' in stored function/trigger because it is already used by statement which invoked this stored function/trigger. DROP TABLE IF EXISTS `test_trigger`; CREATE TABLE `test_trigger` ( `id` ) NOT NULL AUTO_INCR…
MySQL: Solution for ERROR 1442 (HY000): Can't update table 'xxx' in stored function/trigger because it is already used by statement which invoked this stored function/trigger. 今天在做触发器时发生了这个错误 原因是在对某表操作时同时触发对该表插入 估计这在mysql不允许的 不可以把触发条件和触发动作归于一表…
看到mysql的触发器,随手写了一个: mysql> create trigger t_ai_test -> after insert on test -> for each row -> begin -> update test set name='test_1'; -> end;$ Query OK, 0 rows affected (0.00 sec) OK 没问题! mysql> insert into test values(2,'test');$ E…
如果你在触发器里面对刚刚插入的数据进行了 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 ea…
MySql Error: Can't update table in stored function/trigger because it is already used by statement which invoked this stored function/trigger I am running a MySQL Query. But when a new row is added from form input I get this error: Error:Can't update…
MySQL触发器更新本表数据异常:Can't update table 'tbl' in stored function/trigger because it 博客分类: 数据库 MySQLJava 如果你在触发器里面对刚刚插入的数据进行了 insert/update, 则出现这个问题.因为会造成循环的调用. Java代码 收藏代码 create trigger test before update on tablename for each row update tablename set N…