520:
521: ISC_EDW_BOOK_SUM1_F_C.g_push_to_booked_date := nvl(l_to_booked_date,
522: EDW_COLLECTION_UTIL.G_local_curr_push_start_date);
523:
524: EDW_LOG.Put_Line( 'The collection range is from '||
525: to_char(g_push_from_date,'MM/DD/YYYY HH24:MI:SS')||' to '||
526: to_char(g_push_to_date,'MM/DD/YYYY HH24:MI:SS'));
527: EDW_LOG.Put_Line( 'The booked date range is from '||
528: to_char(g_push_from_booked_date,'MM/DD/YYYY HH24:MI:SS')||' to '||
523:
524: EDW_LOG.Put_Line( 'The collection range is from '||
525: to_char(g_push_from_date,'MM/DD/YYYY HH24:MI:SS')||' to '||
526: to_char(g_push_to_date,'MM/DD/YYYY HH24:MI:SS'));
527: EDW_LOG.Put_Line( 'The booked date range is from '||
528: to_char(g_push_from_booked_date,'MM/DD/YYYY HH24:MI:SS')||' to '||
529: to_char(g_push_to_booked_date,'MM/DD/YYYY HH24:MI:SS'));
530: EDW_LOG.Put_Line(' ');
531:
526: to_char(g_push_to_date,'MM/DD/YYYY HH24:MI:SS'));
527: EDW_LOG.Put_Line( 'The booked date range is from '||
528: to_char(g_push_from_booked_date,'MM/DD/YYYY HH24:MI:SS')||' to '||
529: to_char(g_push_to_booked_date,'MM/DD/YYYY HH24:MI:SS'));
530: EDW_LOG.Put_Line(' ');
531:
532: IF (NOT LOCAL_SAME_AS_REMOTE)
533: THEN TRUNCATE_STG;
534: ELSE DELETE_STG;
537: -- --------------------------------------------
538: -- Identify Change for Booked Orders Lines
539: -- --------------------------------------------
540:
541: EDW_LOG.Put_Line('Identifying changed Booked orders lines');
542:
543: FII_UTIL.Start_Timer;
544:
545: l_seq_id_line := IDENTIFY_CHANGE(l_row_count);
556: -- --------------------------------------------
557: -- Push to Local staging table
558: -- --------------------------------------------
559:
560: EDW_LOG.Put_Line(' ');
561: EDW_LOG.Put_Line('Pushing data to local staging');
562:
563: FII_UTIL.Start_Timer;
564:
557: -- Push to Local staging table
558: -- --------------------------------------------
559:
560: EDW_LOG.Put_Line(' ');
561: EDW_LOG.Put_Line('Pushing data to local staging');
562:
563: FII_UTIL.Start_Timer;
564:
565: g_row_count := PUSH_TO_LOCAL(l_seq_id_line);
570: IF (g_row_count = -1)
571: THEN RAISE L_push_local_failure;
572: END IF;
573:
574: EDW_LOG.Put_Line('Inserted '||nvl(g_row_count,0)||' rows into the local staging table');
575: EDW_LOG.Put_Line(' ');
576:
577: COMMIT;
578:
571: THEN RAISE L_push_local_failure;
572: END IF;
573:
574: EDW_LOG.Put_Line('Inserted '||nvl(g_row_count,0)||' rows into the local staging table');
575: EDW_LOG.Put_Line(' ');
576:
577: COMMIT;
578:
579:
592: -- We move data from local to remote staging table
593: -- and clean up local staging
594: -- -----------------------------------------------
595:
596: EDW_LOG.Put_Line(' ');
597: EDW_LOG.Put_Line('Moving data from local staging table to remote staging table');
598:
599: FII_UTIL.Start_Timer;
600:
593: -- and clean up local staging
594: -- -----------------------------------------------
595:
596: EDW_LOG.Put_Line(' ');
597: EDW_LOG.Put_Line('Moving data from local staging table to remote staging table');
598:
599: FII_UTIL.Start_Timer;
600:
601: g_row_count := PUSH_REMOTE;
604: FII_UTIL.Print_Timer('Duration');
605:
606: IF (g_row_count = -1) THEN RAISE l_push_remote_failure; END IF;
607:
608: EDW_LOG.Put_Line(' ');
609: EDW_LOG.Put_Line('Cleaning local staging table');
610:
611: FII_UTIL.Start_Timer;
612:
605:
606: IF (g_row_count = -1) THEN RAISE l_push_remote_failure; END IF;
607:
608: EDW_LOG.Put_Line(' ');
609: EDW_LOG.Put_Line('Cleaning local staging table');
610:
611: FII_UTIL.Start_Timer;
612:
613: TRUNCATE_STG;
621: -- as the source OLTP. We set the status of all our
622: -- records status 'LOCAL READY' to 'READY'
623: -- -----------------------------------------------
624:
625: EDW_LOG.Put_Line(' ');
626: EDW_LOG.Put_Line('Marking records in staging table with READY status');
627:
628: FII_UTIL.Start_Timer;
629:
622: -- records status 'LOCAL READY' to 'READY'
623: -- -----------------------------------------------
624:
625: EDW_LOG.Put_Line(' ');
626: EDW_LOG.Put_Line('Marking records in staging table with READY status');
627:
628: FII_UTIL.Start_Timer;
629:
630: g_row_count := SET_STATUS_READY;
642: -----------------------------------------------
643: -- No exception raised so far. Successful. Call
644: -- wrapup to commit and insert messages into logs
645: -- -----------------------------------------------
646: EDW_LOG.Put_Line(' ');
647: EDW_LOG.Put_Line('Inserted '||nvl(g_row_count,0)||' rows into the staging table');
648: EDW_LOG.Put_Line(' ');
649:
650: EDW_COLLECTION_UTIL.Wrapup(
643: -- No exception raised so far. Successful. Call
644: -- wrapup to commit and insert messages into logs
645: -- -----------------------------------------------
646: EDW_LOG.Put_Line(' ');
647: EDW_LOG.Put_Line('Inserted '||nvl(g_row_count,0)||' rows into the staging table');
648: EDW_LOG.Put_Line(' ');
649:
650: EDW_COLLECTION_UTIL.Wrapup(
651: TRUE,
644: -- wrapup to commit and insert messages into logs
645: -- -----------------------------------------------
646: EDW_LOG.Put_Line(' ');
647: EDW_LOG.Put_Line('Inserted '||nvl(g_row_count,0)||' rows into the staging table');
648: EDW_LOG.Put_Line(' ');
649:
650: EDW_COLLECTION_UTIL.Wrapup(
651: TRUE,
652: g_row_count,
665: errbuf := g_errbuf;
666: retcode := g_retcode;
667: l_exception_msg := errbuf;
668: ROLLBACK; -- Rollback insert into local staging
669: EDW_LOG.Put_Line('Inserting into local staging has failed : '|| l_exception_msg);
670: EDW_COLLECTION_UTIL.Wrapup(
671: FALSE,
672: g_row_count,
673: NULL,
680: retcode := g_retcode;
681: l_exception_msg := errbuf;
682: ROLLBACK; -- rollback any insert into remote site
683: TRUNCATE_STG; -- Cleanup local staging table
684: EDW_LOG.Put_Line('Data migration from local to remote staging has failed : '|| l_exception_msg);
685: EDW_COLLECTION_UTIL.Wrapup(
686: FALSE,
687: g_row_count,
688: NULL,
696: l_exception_msg := errbuf;
697: ROLLBACK; -- Rollback the status to 'LOCAL READY'
698: DELETE_STG; -- Delete records in staging with status 'LOCAL READY'
699: COMMIT;
700: EDW_LOG.Put_Line('Setting status to READY has failed : '|| l_exception_msg);
701: EDW_COLLECTION_UTIL.Wrapup(
702: FALSE,
703: g_row_count,
704: NULL,
712: l_exception_msg := errbuf;
713: DELETE isc_tmp_book_sum1
714: WHERE seq_id IN ( l_seq_id_line);
715: COMMIT;
716: EDW_LOG.Put_Line('Identifying changed records has Failed : '|| l_exception_msg);
717: EDW_COLLECTION_UTIL.Wrapup(
718: FALSE,
719: g_row_count,
720: NULL,
726: errbuf := g_errbuf;
727: retcode := g_retcode;
728: l_exception_msg := errbuf;
729: ROLLBACK;
730: EDW_LOG.Put_Line('Other errors : '|| l_exception_msg);
731: EDW_COLLECTION_UTIL.Wrapup(
732: FALSE,
733: g_row_count,
734: NULL,