105: END IF;
106: --Generates "Warning" message in the Status column of Concurrent Manager "Requests" table
107:
108: if g_debug_flag = 'Y' then
109: edw_log.put_line(' ');
110: edw_log.put_line('INSERTING ' || to_char(sql%rowcount) || ' rows from staging table');
111: edw_log.put_line('g_retcode is'||g_retcode);
112: edw_log.put_line('g_missing_rates '||g_missing_rates);
113: end if;
106: --Generates "Warning" message in the Status column of Concurrent Manager "Requests" table
107:
108: if g_debug_flag = 'Y' then
109: edw_log.put_line(' ');
110: edw_log.put_line('INSERTING ' || to_char(sql%rowcount) || ' rows from staging table');
111: edw_log.put_line('g_retcode is'||g_retcode);
112: edw_log.put_line('g_missing_rates '||g_missing_rates);
113: end if;
114:
107:
108: if g_debug_flag = 'Y' then
109: edw_log.put_line(' ');
110: edw_log.put_line('INSERTING ' || to_char(sql%rowcount) || ' rows from staging table');
111: edw_log.put_line('g_retcode is'||g_retcode);
112: edw_log.put_line('g_missing_rates '||g_missing_rates);
113: end if;
114:
115: END;
108: if g_debug_flag = 'Y' then
109: edw_log.put_line(' ');
110: edw_log.put_line('INSERTING ' || to_char(sql%rowcount) || ' rows from staging table');
111: edw_log.put_line('g_retcode is'||g_retcode);
112: edw_log.put_line('g_missing_rates '||g_missing_rates);
113: end if;
114:
115: END;
116:
295:
296: fii_flex_mapping.free_mem_all;
297:
298: if g_debug_flag = 'Y' then
299: edw_log.put_line('g_row_count is');
300: edw_log.put_line(TO_CHAR(sql%rowcount));
301: end if;
302:
303: RETURN(sql%rowcount);
296: fii_flex_mapping.free_mem_all;
297:
298: if g_debug_flag = 'Y' then
299: edw_log.put_line('g_row_count is');
300: edw_log.put_line(TO_CHAR(sql%rowcount));
301: end if;
302:
303: RETURN(sql%rowcount);
304:
462: WHERE
463: last_update_date BETWEEN g_push_date_range1 and g_push_date_range2;
464:
465: if g_debug_flag = 'Y' then
466: edw_log.put_line(' ');
467: edw_log.put_line('Inserted ' || nvl(SQL%ROWCOUNT,0) || ' records into primary key table' );
468: edw_log.put_line('date passed in '||to_char (p_conversion_date));
469: end if;
470:
463: last_update_date BETWEEN g_push_date_range1 and g_push_date_range2;
464:
465: if g_debug_flag = 'Y' then
466: edw_log.put_line(' ');
467: edw_log.put_line('Inserted ' || nvl(SQL%ROWCOUNT,0) || ' records into primary key table' );
468: edw_log.put_line('date passed in '||to_char (p_conversion_date));
469: end if;
470:
471: IF (FND_INSTALLATION.GET_APP_INFO('FII', l_status, l_industry, l_fii_schema)) THEN
464:
465: if g_debug_flag = 'Y' then
466: edw_log.put_line(' ');
467: edw_log.put_line('Inserted ' || nvl(SQL%ROWCOUNT,0) || ' records into primary key table' );
468: edw_log.put_line('date passed in '||to_char (p_conversion_date));
469: end if;
470:
471: IF (FND_INSTALLATION.GET_APP_INFO('FII', l_status, l_industry, l_fii_schema)) THEN
472:
473: l_stmt := 'ANALYZE TABLE ' || l_fii_schema || '.FII_PA_BUDGET_PK COMPUTE STATISTICS';
474: EXECUTE IMMEDIATE l_stmt;
475:
476: if g_debug_flag = 'Y' then
477: edw_log.put_line('Analyzed primary key table' );
478: end if;
479:
480: END IF;
481:
553: l_date1 := g_push_date_range1;
554: l_date2 := g_push_date_range2;
555:
556: if g_debug_flag = 'Y' then
557: edw_log.put_line( 'The collection range is from '||
558: to_char(l_date1,'MM/DD/YYYY HH24:MI:SS')||' to '||
559: to_char(l_date2,'MM/DD/YYYY HH24:MI:SS'));
560: edw_log.put_line(' ');
561: end if;
556: if g_debug_flag = 'Y' then
557: edw_log.put_line( 'The collection range is from '||
558: to_char(l_date1,'MM/DD/YYYY HH24:MI:SS')||' to '||
559: to_char(l_date2,'MM/DD/YYYY HH24:MI:SS'));
560: edw_log.put_line(' ');
561: end if;
562:
563: -- --------------------------------------------------------
564: -- 1. Clean up any records left from previous process in
565: -- the local staging table.
566: -- --------------------------------------------------------
567:
568: if g_debug_flag = 'Y' then
569: edw_log.put_line(' ');
570: edw_log.put_line('Cleaning up unprocessed records left in local staging table');
571: fii_util.start_timer;
572: end if;
573:
566: -- --------------------------------------------------------
567:
568: if g_debug_flag = 'Y' then
569: edw_log.put_line(' ');
570: edw_log.put_line('Cleaning up unprocessed records left in local staging table');
571: fii_util.start_timer;
572: end if;
573:
574: IF (NOT LOCAL_SAME_AS_REMOTE) THEN
586: -- 2. Identify Changed records int the PA_BUDGET_LINES table
587: -- --------------------------------------------------------
588:
589: if g_debug_flag = 'Y' then
590: edw_log.put_line(' ');
591: fii_util.start_timer;
592: end if;
593:
594: if NOT IDENTIFY_CHANGE(l_conversion_date) THEN
604: -- 3. Pushing data to local staging table
605: -- --------------------------------------------------------
606:
607: if g_debug_flag = 'Y' then
608: edw_log.put_line(' ');
609: edw_log.put_line('Pushing data');
610: fii_util.start_timer;
611: end if;
612:
605: -- --------------------------------------------------------
606:
607: if g_debug_flag = 'Y' then
608: edw_log.put_line(' ');
609: edw_log.put_line('Pushing data');
610: fii_util.start_timer;
611: end if;
612:
613: g_row_count := PUSH_TO_LOCAL;
621: RAISE L_push_local_failure;
622: END IF;
623:
624: if g_debug_flag = 'Y' then
625: edw_log.put_line('Inserted '||nvl(g_row_count,0)||
626: ' rows into the local staging table');
627: edw_log.put_line(' ');
628: end if;
629:
623:
624: if g_debug_flag = 'Y' then
625: edw_log.put_line('Inserted '||nvl(g_row_count,0)||
626: ' rows into the local staging table');
627: edw_log.put_line(' ');
628: end if;
629:
630: -- --------------------------------------------------------
631: -- 4. Clean up any records left from previous process in
632: -- the FII_PA_BUDGET_PK table
633: -- --------------------------------------------------------
634:
635: if g_debug_flag = 'Y' then
636: edw_log.put_line(' ');
637: edw_log.put_line('Cleaning up unprocessed records left in primary key table');
638: end if;
639:
640: -- note that TRUNCATE statement does implicit commit;
633: -- --------------------------------------------------------
634:
635: if g_debug_flag = 'Y' then
636: edw_log.put_line(' ');
637: edw_log.put_line('Cleaning up unprocessed records left in primary key table');
638: end if;
639:
640: -- note that TRUNCATE statement does implicit commit;
641:
678: -- and clean up local staging
679: -- -----------------------------------------------
680:
681: if g_debug_flag = 'Y' then
682: edw_log.put_line(' ');
683: edw_log.put_line('Moving data from local staging table to remote staging table');
684: fii_util.start_timer;
685: end if;
686:
679: -- -----------------------------------------------
680:
681: if g_debug_flag = 'Y' then
682: edw_log.put_line(' ');
683: edw_log.put_line('Moving data from local staging table to remote staging table');
684: fii_util.start_timer;
685: end if;
686:
687: g_row_count := PUSH_REMOTE;
693:
694: IF (g_row_count = -1) THEN RAISE l_push_remote_failure; END IF;
695:
696: if g_debug_flag = 'Y' then
697: edw_log.put_line(' ');
698: edw_log.put_line('Cleaning local staging table');
699: fii_util.start_timer;
700: end if;
701:
694: IF (g_row_count = -1) THEN RAISE l_push_remote_failure; END IF;
695:
696: if g_debug_flag = 'Y' then
697: edw_log.put_line(' ');
698: edw_log.put_line('Cleaning local staging table');
699: fii_util.start_timer;
700: end if;
701:
702: TRUNCATE_STG;
713: -- records status 'LOCAL READY' to 'READY'
714: -- -----------------------------------------------
715:
716: if g_debug_flag = 'Y' then
717: edw_log.put_line(' ');
718: edw_log.put_line('Marking records in staging table with READY status');
719: fii_util.start_timer;
720: end if;
721:
714: -- -----------------------------------------------
715:
716: if g_debug_flag = 'Y' then
717: edw_log.put_line(' ');
718: edw_log.put_line('Marking records in staging table with READY status');
719: fii_util.start_timer;
720: end if;
721:
722: g_row_count := SET_STATUS_READY;
730: IF (g_row_count = -1) THEN RAISE l_set_status_failure; END IF;
731: END IF;
732:
733: if g_debug_flag = 'Y' then
734: edw_log.put_line(' ');
735: edw_log.put_line('Inserted '||nvl(g_row_count,0)|| ' rows into the staging table');
736: edw_log.put_line(' ');
737: end if;
738:
731: END IF;
732:
733: if g_debug_flag = 'Y' then
734: edw_log.put_line(' ');
735: edw_log.put_line('Inserted '||nvl(g_row_count,0)|| ' rows into the staging table');
736: edw_log.put_line(' ');
737: end if;
738:
739: -- -----------------------------------------------
732:
733: if g_debug_flag = 'Y' then
734: edw_log.put_line(' ');
735: edw_log.put_line('Inserted '||nvl(g_row_count,0)|| ' rows into the staging table');
736: edw_log.put_line(' ');
737: end if;
738:
739: -- -----------------------------------------------
740: -- Successful. Commit and call
747: -- Clean up any records in the FII_PA_BUDGET_PK table
748: -- --------------------------------------------------------
749:
750: if g_debug_flag = 'Y' then
751: edw_log.put_line(' ');
752: edw_log.put_line('Cleaning up primary key table');
753: end if;
754:
755: /* IF NOT TRUNCATE_PK THEN
748: -- --------------------------------------------------------
749:
750: if g_debug_flag = 'Y' then
751: edw_log.put_line(' ');
752: edw_log.put_line('Cleaning up primary key table');
753: end if;
754:
755: /* IF NOT TRUNCATE_PK THEN
756: -- Normally this error will not occur - Collection concurrent
768: EDW_COLLECTION_UTIL.wrapup(TRUE, g_row_count, null, g_push_date_range1, g_push_date_range2);
769: if (g_missing_rates >0) then
770:
771: if g_debug_flag = 'Y' then
772: edw_log.put_line ('Records with missing rates identified in source and not loaded to warehouse');
773: end if;
774:
775: end if;
776:
780: Errbuf:=g_errbuf;
781: Retcode:=g_retcode;
782: l_exception_msg := Retcode || ':' || Errbuf;
783: if g_debug_flag = 'Y' then
784: edw_log.put_line('ERROR: Identifying changed records have Failed');
785: end if;
786: EDW_COLLECTION_UTIL.wrapup(FALSE, 0, l_exception_msg, g_push_date_range1, g_push_date_range2);
787: WHEN L_PUSH_LOCAL_FAILURE THEN
788: rollback;
789: Errbuf:=g_errbuf;
790: Retcode:=g_retcode;
791: l_exception_msg := Retcode || ':' || Errbuf;
792: if g_debug_flag = 'Y' then
793: edw_log.put_line('ERROR: Inserting into local staging have failed');
794: end if;
795: EDW_COLLECTION_UTIL.wrapup(FALSE, 0, l_exception_msg, g_push_date_range1, g_push_date_range2);
796: WHEN L_PUSH_REMOTE_FAILURE THEN
797: rollback;
798: Errbuf:=g_errbuf;
799: Retcode:=g_retcode;
800: l_exception_msg := Retcode || ':' || Errbuf;
801: if g_debug_flag = 'Y' then
802: edw_log.put_line('ERROR: Data migration from local to remote staging have failed');
803: end if;
804: EDW_COLLECTION_UTIL.wrapup(FALSE, 0, l_exception_msg, g_push_date_range1, g_push_date_range2);
805: WHEN L_SET_STATUS_FAILURE THEN
806: rollback;
807: Errbuf:=g_errbuf;
808: Retcode:=g_retcode;
809: l_exception_msg := Retcode || ':' || Errbuf;
810: if g_debug_flag = 'Y' then
811: edw_log.put_line('ERROR: Setting status to READY have failed');
812: end if;
813: EDW_COLLECTION_UTIL.wrapup(FALSE, 0, l_exception_msg, g_push_date_range1, g_push_date_range2);
814: WHEN L_TRUNCATE_TMP_PK_FAILURE THEN
815: rollback;
816: Errbuf:=g_errbuf;
817: Retcode:=g_retcode;
818: l_exception_msg := Retcode || ':' || Errbuf;
819: if g_debug_flag = 'Y' then
820: edw_log.put_line('ERROR: Clean-up of primary key table failed');
821: edw_log.put_line(' ');
822: end if;
823: EDW_COLLECTION_UTIL.wrapup(FALSE, 0, l_exception_msg, g_push_date_range1, g_push_date_range2);
824: WHEN OTHERS THEN
817: Retcode:=g_retcode;
818: l_exception_msg := Retcode || ':' || Errbuf;
819: if g_debug_flag = 'Y' then
820: edw_log.put_line('ERROR: Clean-up of primary key table failed');
821: edw_log.put_line(' ');
822: end if;
823: EDW_COLLECTION_UTIL.wrapup(FALSE, 0, l_exception_msg, g_push_date_range1, g_push_date_range2);
824: WHEN OTHERS THEN
825: rollback;