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;
精彩评论