概述
delimiter//CREATEPROCEDUREttpr(intaint,outtbvarchar(11),outtctext,outifmvarchar(12))beginsetautocommit=0;declareyeeintdefault0;selectexists(select*fromt2)intoyee;ifyee=1t...
delimiter //
CREATE PROCEDURE ttpr
(in ta int,
out tb varchar(11),
out tc text,
out ifm varchar(12)
)
begin
set autocommit=0;
declare yee int default 0;
select exists(select * from t2) into yee;
if yee=1
then
select b,c into tb,tc from t2 where a=ta;
else
select cast('unknown b' as char),'unknowm c' into tb,tc;
end if;
if @@error_count != 0
then
begin
select 'you fail it' into ifm;
rollback;
end;
else
begin
select 'you win it' into ifm;
commit;
end;
end if;
set autocommit=1;
end;
//
报错:
#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 'declare yee int default 0;
select exists(select * from t2) into yee;
if yee=' at line 10
展开
最后
以上就是柔弱雪糕为你收集整理的mysql 事务一直running_mysql事务一直报错,找不到原因。的全部内容,希望文章能够帮你解决mysql 事务一直running_mysql事务一直报错,找不到原因。所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复