хочу проетестировать процедуру поэтмоу прошу переделать под выборку
procedure GET_RP_CONSTRUCTOR_HISTORY(
        -- ip_subs_id            IN number,
         ip_subs_id           IN subscribers.subs_id%type,
         ip_row_first         IN number,
         ip_row_last          IN number,
         oa_num_change        OUT SBMS_RP_CONST_TEMPL_AQF_BIS.NUM10_ARRAY,
         oa_name_preassembly  OUT SBMS_RP_CONST_TEMPL_AQF_BIS.NAME255_ARRAY,
         oa_start_date        OUT SBMS_RP_CONST_TEMPL_AQF_BIS.DATE_ARRAY,
         oa_end_date          OUT SBMS_RP_CONST_TEMPL_AQF_BIS.DATE_ARRAY,
         oa_user_method       OUT SBMS_RP_CONST_TEMPL_AQF_BIS.NAME50_ARRAY,
         oa_date_operation    OUT SBMS_RP_CONST_TEMPL_AQF_BIS.DATE_ARRAY,
         oa_sum_AP            OUT SBMS_RP_CONST_TEMPL_AQF_BIS.NUM10_ARRAY,
         op_total             OUT number)
is
 total_count NUM10_ARRAY;
begin
  select t.rn
        ,t.rp_name || NVL(t.template_constr,'') || ' ' || t.options as rp_name
        ,t.start_date
        ,t.end_date
        ,t.navi_user
        ,t.navi_date
        ,t.price
        ,t.total
    bulk collect into oa_num_change
                    , oa_name_preassembly
                    , oa_start_date
                    , oa_end_date
                    , oa_user_method
                    , oa_date_operation
                    , oa_sum_AP
                    , total_count
  from (
        select
           row_number() over (order by t.navi_date) rn
          ,aqfreq_id
          ,rp.name_r as rp_name
          ,(select '(' || tmp.name || ')' from AQF$CNTR_TEMPLATE tmp
               where tmp.aqftm_id = XMLTYPE(t.DATA).EXTRACT('//@template_id').getNumberVal())
                  as template_constr
          ,(select listagg(o.short_name ,'/') within group (order by bl.position) as pack
            from
              AQF$CNTR_SUBS_OPTIONS so
              ,AQF$CNTR_OPTIONS o
              ,aqf$cntr_base_lines bl
            where AQFREQ_AQFREQ_ID = t.aqfreq_id
            and so.aqfo_aqfo_id = o.aqfo_id
            and bl.aqfbl_id = o.aqfbl_aqfbl_id
            and nvl(o.volume,0) != 0
           ) options
          ,AQF$CNTR_PG.GET_REQUEST_PRICE(t.aqfreq_id) price
          ,process_date as start_date
          ,nvl(del_date,to_date('31.12.2999','dd.mm.yyyy')) as end_date
          ,t.navi_user as navi_user
          ,t.navi_date as navi_date
          ,count(*) over() total
        from bis.aqf$cntr_requests t
          left join bis.rate_plans rp on rp.RTPL_ID = t.RTPL_RTPL_ID  and rp.start_date <= t.navi_date and rp.end_date > t.navi_date
        where subs_subs_id = ip_subs_id
          and AQFRQTP_AQFRQTP_ID = 1
        ) t
    where t.rn >= ip_row_first and t.rn <= ip_row_last
      order by t.rn;

  op_total := case when total_count.count > 0 then total_count(1) else 0 end;
end GET_RP_CONSTRUCTOR_HISTORY;