This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12130|Reply: 1

[New Issue] error code 1324:undefined CURSOR:cursor_employee

[Copy link]
Posted on 11/16/2018 10:51:25 AM | | |
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;





Previous:This is what a working PPT should do
Next:Error occurred when trying to send rpc requests(s)
Posted on 11/16/2018 6:25:47 PM |
Wrong?
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com