0

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;
2
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by code739
0
> 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;

I haven't tried this but you have four items within the bracket and five afterwards. Dont think you declared properly

0

its already solve there's an error the error is not in the procedure its in the trigger where i called the procedure. thanks anyways in replying

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.