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;

Recommended Answers

All 2 Replies

> 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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.