hi guys i got some problem with this code
error said that exact fetch row return more than expected rows
CREATE OR REPLACE PROCEDURE "MAINTAIN_REQUESTSTATUS1"
(emplevel IN NUMBER,eid IN NUMBER,depid IN NUMBER,teamid IN NUMBER)
is
lastreq number;
seq number;
stat NUMBER;
tok varchar2(60);
appr number;
CURSOR c1
IS
select empid from employee_master where emp_level>emplevel and depid=depid and team_id=teamid;
begin
select max(reqid) into lastreq from request_master;
seq:=0;
open c1;
loop
fetch c1 into appr;
if c1%NOTFOUND then
exit;
else
seq:=seq+1;
if seq=1 then
stat:=1;
else
stat:=0;
end if;
tok:= appr||'~'||lastreq||'~mobile~'||seq;
insert into request_status(reqid,rstatus,token,sequence,appid)
values(lastreq,stat,tok,seq,appr);
end if;
end loop;
close c1;
end;