我正在创建触发器,但它向我显示以下错误:
15:22:44 create trigger trigger3 before update on test.testdata
for each row
begin
if new.qty < 50 then
SIGNAL SQLSTATE VALUE '99999'
SET MESSAGE_TEXT = 'An error occurred';
end if;
end;
Error Code: 1064. You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax to use near 'SQLSTATE VALUE '99999'
SET MESSAGE_TEXT = 'An error occurred';
end i' at line 8 0.000 sec
我的触发代码是:
delimiter //
create trigger trigger3 before update on test.testdata
for each row
begin
if new.qty < 50 then
SIGNAL SQLSTATE VALUE '99999'
SET MESSAGE_TEXT = 'An error occurred';
end if;
end;
//
delimiter ;