架构师_程序员_码农网

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 6765|回复: 1

[新问题] error code 1324:undefined CURSOR:cursor_employee

[复制链接]
发表于 2018-11-16 10:51:25 | 显示全部楼层 |阅读模式
delimiter //
#创建存储过程
create procedure employee_count(out num int)
begin
#声明变量
declare employee_sal int;
declare flag int;
#声明游标
declare cursor_employee cursor for select sal from t_employee;
declare continue handler for not found set flag=1;
#设置结束标志
set flag=0;
set num=0;
#打开游标
open cursor_employee;
#遍历游标指向的结果集
fetch cursor_emplyee into employee_sal;
where flag<>1 do
if employee_sal >999 then
set num=num+1;
end if;
fetch cursor_employee into emplyee_sal;
end while;
#关闭游标
close cursor_employee;
end //
delimiter;





上一篇:工作型PPT应该这样做
下一篇:Error occurred when trying to send rpc requests(s)
码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
发表于 2018-11-16 18:25:47 | 显示全部楼层
错误?
码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

免责声明:
码农网所发布的一切软件、编程资料或者文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:help@itsvse.com

QQ|手机版|小黑屋|架构师 ( 鲁ICP备14021824号-2 )|网站地图

GMT+8, 2024-4-26 18:58

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表