create or replace procedure proc1(p_collageid in number)is
    
begin
for v_stuid in (select ts.stuid
from 
(select 
      stuid,rownum rn
from 
      (select stuid from totalscore where total>(select grade from college where collegeid = p_collageid) 
      and firstwill = p_collageid
      order by total desc)) ts,college col
where
      col.collegeid = p_collageid
and
     ts.rn < col.plan_total) loop
    dbms_output.put_line(v_stuid.stuid);
end loop;
end;如上所示,我希望能够得到游标一共输出了几行数据,或者说是几个数据,可否在存储过程中添加一个内部的变量,使其在for循环中自加 1打到,或者需要定义一个全局变量,或者有其他方式,求指点,谢谢各位大佬。