AI智能
改变未来

[MySQL]MySQL的signal sqlstate

[code]drop trigger trig_test;create trigger trig_test before insert on udf_update_deliveryfor each rowbegindeclare msg varchar(20);set msg=\'提交数据错误,请检查\';if new.delivery_no like \'99-300101%\' thensignal sqlstate \'45000\' set message_text=msg;end if;end;insert into udf_update_delivery(delivery_no,is_update,update_date)values(\'99-300101111\',1,\'2020-03-10\')drop trigger trig_srm_delivery_head;create trigger trig_srm_delivery_head before insert on srm_delivery_headfor each rowbegindeclare msg varchar(20);set msg=\'提交数据错误,请检查\';if new.delivery_no like \'99-300101%\' thensignal sqlstate \'45000\' set message_text=msg;end if;end;

 

赞(0) 打赏
未经允许不得转载:爱站程序员基地 » [MySQL]MySQL的signal sqlstate