• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

关于mysql存储过程 cursor解决方法

mysql 搞代码 7年前 (2018-05-31) 151次浏览 已收录 0个评论

关于mysql存储过程 cursor
mysql存储过程中,
定义一个cursor
在cursor里面:
  有一个select field1 into vari1 from table where tindex = 0;
如果select * from table where tindex = 0不存在的话,
存储过程会自动将done 置为1,这个就退出了cursor,

请问各位:
如果不存在select * from table where tindex = 0的话,那么
select field1 into vari1 from table where tindex = 0;这条赋值语句该怎么写

——解决方案——————–
….
select field1 into vari1 from table where tindex = 0;
set done=0

——解决方案——————–

引用

如果不存在select * from table where tindex = 0的话,那么
select field1 into vari1 from table where tindex = 0;这条赋值语句该怎么写

——解决方案——————–
建议贴出你完整的代码以便理解。


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:关于mysql存储过程 cursor解决方法
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址