Hi All,

This is my procedure, i am using cursor to access data one row by one. The
cursor is looping twice, though i have only one row data in the DB
table(playersloginfo). Can any body tell me why cursor is looping twice and
how can i control it, And please explain me what is this " declare continue
handler for sqlstate '02000' ". I will be glad if anybody answer to me.

create procedure activity1()
begin
declare done int default 0;
declare pack text;
declare name, logout, login varchar(50);
set pack='';
declare cur1 cursor for select user_name, concat(logindate, ' ', logintime),
concat(logoutdate, ' ',logouttime) from playersloginfo;
declare continue handler for sqlstate '02000' set done = 1;
open cur1;
repeat
fetch cur1 into name, login, logout;
set pack = concat(pack, name, ',', login, ',', logout,';');
until done end repeat;
select pack;
close cur1;
end;|

Reply via email to