sys_refcursor使用实例1:

procedure 存储过程名称(参数)
IS
v_id 表.字段%type;
v_cursub sys_refcursor;
begin
  
      open v_cursub for 'select a.id from ss'||user_ky||' a
                            where b.id is null';
      loop
        fetch v_cursub into v_id;
        exit when v_cursub%notfound;
        ......--操作内容
      end loop;
      
exception when others then
  rollback;
  v_res_code:=0;
  v_res_msg:=sqlerrm;
end 存储过程名称;

 

posted on 2016-05-04 14:21  清风暮雨  阅读(484)  评论(0)    收藏  举报