hi
the follwing procedure shows run time error :
DELIMITER $$
DROP PROCEDURE IF EXISTS `rec_detail`.`s p2` $$
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='EN T' or file_status='RE N';
while y2>0 do
select file_id into x from rec_detail.file _index where file_status='EN T' or file_status='RE N';
set y2=y2-1;
end while;
select count(*) into y3 from rec_detail.docu ment_index where document_status ='ENT' or document_Status ='REN';
while y3>0 do
select document_id into x from rec_detail.docu ment_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='EN T' or page_status='RE N';
while y4>0 do
select page_id into x from rec_detail.page _index where page_status='EN T' or page_status='RE N';
set y4=y4-1;
end while;
select count(*) into y5 from rec_detail.othe r_index where other_status='E NT' or other_status='R EN';
while y5>0 do
select other_id into x from rec_detail.othe r_index where other_status='E NT' or other_status='R EN';
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
the follwing procedure shows run time error :
DELIMITER $$
DROP PROCEDURE IF EXISTS `rec_detail`.`s p2` $$
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='EN T' or file_status='RE N';
while y2>0 do
select file_id into x from rec_detail.file _index where file_status='EN T' or file_status='RE N';
set y2=y2-1;
end while;
select count(*) into y3 from rec_detail.docu ment_index where document_status ='ENT' or document_Status ='REN';
while y3>0 do
select document_id into x from rec_detail.docu ment_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='EN T' or page_status='RE N';
while y4>0 do
select page_id into x from rec_detail.page _index where page_status='EN T' or page_status='RE N';
set y4=y4-1;
end while;
select count(*) into y5 from rec_detail.othe r_index where other_status='E NT' or other_status='R EN';
while y5>0 do
select other_id into x from rec_detail.othe r_index where other_status='E NT' or other_status='R EN';
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