概述
看到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');$
ERROR 1442 (HY000): Can't update
table 'test' in stored function/trigger because it is already used
by statement which invoked this stored function/trigge
执行插入就报这个错。
查官网是这么回答的:
Old question, but in case anyone
finds this: MySQL triggers can't manipulate the table they are
assigned to. All other major DBMS support this feature so hopefully
MySQL will add this support soon.
answered Feb 22 '10 at
21:16
“MySQL
will add this support
最后
以上就是明理音响为你收集整理的mysql1442错误_ERROR 1442 (HY000):because it is already used by statement which invoked this stored fun...的全部内容,希望文章能够帮你解决mysql1442错误_ERROR 1442 (HY000):because it is already used by statement which invoked this stored fun...所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复