user712821
user712821

Reputation: 11

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 procedure, mysql show error message('1324-Undefined CURSOR in mysql), anybody please tell solution, am using mysql server 5.0

Upvotes: 1

Views: 3252

Answers (2)

Arun nagar
Arun nagar

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

codeulike
codeulike

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

Related Questions