create or replace 
PROCEDURE PAID_REPORT 
(
  PAYMENT_STATUS IN VARCHAR2  
) ASlinecount number(4);
linecounttwo number(4);
--animal varchar2 (12);
animaltype varchar2(12);
visitid number (6);
 
cursor vetCursor is 
select pb_vet.vetid,visitid,lastname,firstname
from pb_visit,pb_vet
where pb_visit.vetid = pb_vet.vetid
and pb_visit.status = PAYMENT_STATUS
order by lastname, firstname;
vetRow vetCursor%rowtype;cursor visitCursor is
select visitid,name,lastname,firstname
from pb_client,pb_animal,pb_visit
where pb_client.cliEntid=pb_animal.clientid
and pb_visit.animalid=pb_animal.animalid
and status = PAYMENT_STATUS;
visitRow visitCursor%rowtype;BEGIN
linecounttwo:=0;
open visitCursor;
loop
fetch visitCursor
into visitRow;
exit when visitCursor%notfound;
linecounttwo:=linecounttwo+1;end loop;
  linecount:=0;
  open vetCursor;
  loop
  fetch vetCursor
  into vetRow;
  
  exit when vetCursor%notfound;
  dbms_output.put_line('Veterinarian ID: '||vetRow.vetid||'   '||vetRow.lastname||','||vetRow.firstname);     linecount:=linecount+1;
  end loop;
  close vetCursor;
END PAID_REPORT;
这个打完之后会返回几行VET ID 和ID的相关信息
      我希望在每一行下面要列出一些VET相关的信息,需要调用返回的这个vet ID,也就是说每返回一个ID的话,就需要把这个ID当成一个参数来查询一些相关信息。 现在这个vet ID就是一行行打出来,就是不知道如何调用。怕我表达的不清楚,换个形象的例子CLASS ID:  0001          English
         Student A    19
         Student B    21CLASS ID:  0004          Maths
         Student A    19
         Student B    21
相当于我现在class的那行已经有了,现在就是想列出和每个class相关的student。