本文主要是介绍[MySQL]MySQL的signal sqlstate,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
drop trigger trig_test;
create trigger trig_test before insert on udf_update_delivery
for each row
begin
declare msg varchar(20);
set msg='提交数据错误,请检查';
if new.delivery_no like '99-300101%' then
signal 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_head
for each row
begin
declare msg varchar(20);
set msg='提交数据错误,请检查';
if new.delivery_no like '99-300101%' then
signal sqlstate '45000' set message_text=msg;
end if;
end;
这篇关于[MySQL]MySQL的signal sqlstate的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!