procedure GETRPCONSTRUCTORHISTORY( -- ipsubsid IN number, ipsubsid IN…
- User
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 AQFCNTR_SUBS_OPTIONS so ,AQFcntr_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 ,AQFcntr_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;
- Assistant
This procedure retrieves the history of rate plan constructor changes for a subscriber. It takes in the subscriber ID, the first and last rows to retrieve, and several OUT parameters that will be populated with the results of the query.
The query uses several nested SELECT statements to retrieve information about each rate plan constructor change, including the rate plan name, any template constraints, subscription options, request price, start and end dates, and user and date of the change.
After the query is executed and the results are collected into the OUT parameters, the total number of rows is stored in the op_total parameter. This parameter is used to display the total number of rows to the user.