Reputation: 11
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 procedure, mysql show error message('1324-Undefined CURSOR in mysql), anybody please tell solution, am using mysql server 5.0
Upvotes: 1
Views: 3252
Reputation: 176
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;
Upvotes: 0
Reputation: 23064
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;
Upvotes: 1