开发者

1324- undefined CURSOR in mysql

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜