游标数据循环执行存储过程

如下:

create or replace procedure testdate_2 is
i number;
out1 varchar2(100);
out2 varchar2(100);
CUSTOMERID NUMBER;
cursor projidlist is select p.projid from proj_baseinfo p where p.projstage!='-999';
begin

  for i in projidlist LOOP
      begin
          select p.customerid into CUSTOMERID from proj_baseinfo p where p.projid=i.projid;
          --testdate_3(i.projid);
          PRO_PROJ_REPORT_CRM_FINAN(i.projid,CUSTOMERID,out1,out2);
         -- dbms_output.put_line(i.projidlist);
      end;
  end LOOP;
commit;
end testdate_2;

 

end;

posted @ 2021-04-21 16:55  xh_Blog  阅读(149)  评论(0编辑  收藏  举报