解决Error Code: 1442. Can‘t update table ‘b05‘ in stored functiontrigger becaus的问题

it2025-04-01  10

1,发生源头

想要在插入或者更新数据之后修改数据,

2,失败原因

因为MySQL不让在触发器触发insert和update的时候不让执行inset和update

3,解决办法

改用set语句 eg

create trigger insertb05 before insert ON b05 FOR EACH ROW set new.b05_04=100;

执行测试:

insert into b05 values(4,200,50,40,0);

问题解决

最新回复(0)