378: close c_measure_values;
379:
380: -- Begin statement is used for exception handling.
381: begin
382: update bic_party_summ set
383: ASSOCIATION_YRS = nvl(l_ASSOCIATION_YRS , ASSOCIATION_YRS ),
384: AVG_CLOSED_SRS = nvl(l_AVG_CLOSED_SRS , AVG_CLOSED_SRS ),
385: AVG_COMPLAINTS = nvl(l_AVG_COMPLAINTS , AVG_COMPLAINTS ),
386: AVG_HOLD_TIME = nvl(l_AVG_HOLD_TIME , AVG_HOLD_TIME ),
460: and party_id = g_party_id
461: and nvl(org_id,-99) = nvl(g_org_id,-99);
462:
463: if sql%notfound then
464: insert into bic_party_summ (
465: party_id ,
466: org_id,
467: period_start_date,
468: ASSOCIATION_YRS ,
644: x_err
645: );
646: commit;
647: *******************************/
648: end; -- of block for inserting record into bic_party_summ table.
649:
650: end loop;
651: close c_parties;
652: end populate_party_data;
657: -- For a given date range, This cursor gets all parties and period,
658: -- which have any data in bic_customer_summary_all
659: cursor c_parties is
660: select distinct party_id, period_start_date
661: from bic_party_summary
662: where period_start_date between p_start_date and p_end_date;
663:
664: -- This cursor gets measure_code and its value for a party and period
665: cursor c_measure_values is
663:
664: -- This cursor gets measure_code and its value for a party and period
665: cursor c_measure_values is
666: select measure_code, value
667: from bic_party_summary
668: where period_start_date = g_date
669: and party_id = g_party_id;
670:
671: l_date date;
765: x_err
766: );
767: commit;
768: ******************/
769: end; -- of block for inserting record into bic_party_summ table.
770:
771: end loop;
772: close c_parties;
773: end populate_status_data;
772: close c_parties;
773: end populate_status_data;
774: ----
775: ----
776: -- This procedure updates market segment for each party in bic_party_summ
777: -- and bic_party_status_summ tables.
778: procedure update_market_segment is
779: begin
780: update bic_party_summ summ
776: -- This procedure updates market segment for each party in bic_party_summ
777: -- and bic_party_status_summ tables.
778: procedure update_market_segment is
779: begin
780: update bic_party_summ summ
781: set market_segment_id = (select market_segment_id
782: from ams_party_market_segments mseg
783: where market_segment_flag = 'Y'
784: and mseg.party_id = summ.party_id
808: delete from bic_customer_summary_all
809: where period_start_date between p_start_date and p_end_date;
810: commit;
811:
812: -- delete records from bic_party_summary
813: delete from bic_party_summary
814: where period_start_date between p_start_date and p_end_date;
815: commit;
816: end purge_summary_data;
809: where period_start_date between p_start_date and p_end_date;
810: commit;
811:
812: -- delete records from bic_party_summary
813: delete from bic_party_summary
814: where period_start_date between p_start_date and p_end_date;
815: commit;
816: end purge_summary_data;
817:
817:
818: procedure purge_party_summary_data is
819: begin
820:
821: -- delete records from bic_party_summary
822: delete
823: from bic_party_summary;
824: -- commit;
825: end purge_party_summary_data;
819: begin
820:
821: -- delete records from bic_party_summary
822: delete
823: from bic_party_summary;
824: -- commit;
825: end purge_party_summary_data;
826:
827: procedure purge_customer_summary_data is