要想利用rownum ,这样试试
cursor findoutservalltest(tel varchar2, status int,v_countnum int) is
select * from(select rownum rnum,a.FtelNo,a.FService,a.FParam,a.FStatus,b.FServiceName from sm_orderinfo a,sm_service b
where a.fservice=b.fservice and a.ftelno=tel AND a.FStatus=status )
where rnum=v_countnum;
cursor findoutservalltest(tel varchar2, status int,v_countnum int) is
select * from(select rownum rnum,a.FtelNo,a.FService,a.FParam,a.FStatus,b.FServiceName from sm_orderinfo a,sm_service b
where a.fservice=b.fservice and a.ftelno=tel AND a.FStatus=status )
where rnum=v_countnum;
cursor findoutservalltest(tel varchar2, status int,v_countnum int) is
select * from(select rownum rnum,a.FtelNo,a.FService,a.FParam,a.FStatus,b.FServiceName from sm_orderinfo a,sm_service b
where a.fservice=b.fservice and a.ftelno=tel AND a.FStatus=status )
where rnum=v_countnum;
begin
for v_sor in findoutservalltest(p_tel,p_status,p_countnum) loop
update sm_orderinfo set sm_orderinfo=0 where 条件=v_sor.rnum;
end loop;
end;