hi
the follwing procedure shows run time error :
DELIMITER $$
DROP PROCEDURE IF EXISTS `rec_detail`.`sp2` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`(x varchar(22))
BEGIN
declare y1 int;
declare y2 int;
declare y3 int;
declare y4 int;
declare y5 int;
select count(*) into y1 from rec_detail.box_index where box_status='ENT' or box_status='REN';
while y1>0 do
select box_id into x from rec_detail.box_index where box_status='ENT' or box_status='REN';
set y1=y1-1;
end while;
select count(*) into y2 from rec_detail.file_index where file_status='ENT' or file_status='REN';
while y2>0 do
select file_id into x from rec_detail.file_index where file_status='ENT' or file_status='REN';
set y2=y2-1;
end while;
select count(*) into y3 from rec_detail.document_index where document_status='ENT' or document_Status='REN';
while y3>0 do
select document_id into x from rec_detail.document_index where document_status='ENT' or document_status='REN';
set y3=y3-1;
end while;
select count(*) into y4 from rec_detail.page_index where page_status='ENT' or page_status='REN';
while y4>0 do
select page_id into x from rec_detail.page_index where page_status='ENT' or page_status='REN';
set y4=y4-1;
end while;
select count(*) into y5 from rec_detail.other_index where other_status='ENT' or other_status='REN';
while y5>0 do
select other_id into x from rec_detail.other_index where other_status='ENT' or other_status='REN';
set y5=y5-1;
end while;
END $$
DELIMITER ;
ERROR :
Result consisted of more than one row - Error No1172
But i need all the values to get through x give me a solution