menggudaoke 2012-04-15 23:09 采纳率: 0%
浏览 226
已采纳

mysql中建存储过程,总是提示如下问题,代码及错误提示如下,不知道哪里错了

create procedure BookID_Generate(in_ISBN char(18),count int,firstID char(10))
begin
while count > 0 do
insert into tblend values(firstID,in_ISBN,'否');
set firstID=firstID+1;
set count=count-1;
end while;
end;

这里in_ISBN, count,firstID三个都是要输入的变量,前面加in同样也报错

ERROR 1064 (42000): 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 '' at line 4
mysql> set firstID=firstID+1;
ERROR 1193 (HY000): Unknown system variable 'firstID'
mysql> set count=count-1;
ERROR 1193 (HY000): Unknown system variable 'count'
mysql> end while;
ERROR 1064 (42000): 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 'end while' at line 1
mysql> end;

  • 写回答

3条回答 默认 最新

  • zyn010101 2012-04-16 23:30
    关注

    你在什么地方执行的?我的脚步是在navicat的查询中执行通过的。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题