List:General Discussion« Previous MessageNext Message »
From:balaraju mandala Date:April 13 2007 12:14pm
Subject:problem with Procedure and Cursor
View as plain text  
Hi all,

I am getting problem with this Procedure, i am reading the values using a
cursor, and appending them to variable. but i am getting null as output. Can
anybody please tell where is the wrong.

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;|

Thread
problem with Procedure and Cursorbalaraju mandala13 Apr
Re: problem with Procedure and CursorPeter Brawley14 Apr