当前位置:数据库 > Oracle >>

oracle带参数的游标

oracle带参数的游标
 
declare cursor mysor(proname varchar2) is
select * from sys_pro_monitor where pro_name=proname;
c_row mysor%rowtype;
begin
 open mysor('PRO_RPT_KPI') ;
 loop
   fetch mysor into c_row;
   exit when mysor%notfound;
   dbms_output.put_line(c_row.id);
 end loop;
end;
 
第二种写法:  www.zzzyk.com  
declare cursor mysor(proname varchar2) is
select * from sys_pro_monitor where pro_name=proname;
c_row mysor%rowtype;
begin
 for c_row in mysor('PRO_RPT_KPI') loop
 dbms_output.put_line(c_row.id);
 end loop;
end;
 
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,