开发者

1324- undefined CURSOR in mysql

开发者 https://www.devze.com 2023-02-28 01:01 出处:网络
begin declarei integer; declare cur cursor for select ecmtwork.mttotalline from ectmwork; OPEN cur; repeat
begin
    declare  i integer;
    declare cur cursor for select ecmtwork.mttotalline from ectmwork;
    OPEN cur;
    repeat
        fetch cut into i;
        until i =  468;       
    end repeat;
    close cur;
end;

I try to run this procedu开发者_开发知识库re, mysql show error message('1324-Undefined CURSOR in mysql), anybody please tell solution, am using mysql server 5.0


Looks like you've got the name of the cursor wrong in line6. i.e the line

fetch cut into i;

should be

fetch cur into i;


your program should be

   begin
declare  i integer;
declare cur cursor for select ecmtwork.mttotalline from ectmwork;
OPEN cur;
repeat
    fetch cur into i;
    until i =  468;       
end repeat;
close cur;
  end;
0

精彩评论

暂无评论...
验证码 换一张
取 消