51: END IF;
52:
53: -- Generates "Warning" message in the Status column
54: -- of Concurrent Manager "Requests" table
55: edw_log.put_line(' ');
56: edw_log.put_line('INSERTING ' || to_char(sql%rowcount) ||
57: ' rows into poa_edw_rcv_txns_inc table');
58: END;
59:
52:
53: -- Generates "Warning" message in the Status column
54: -- of Concurrent Manager "Requests" table
55: edw_log.put_line(' ');
56: edw_log.put_line('INSERTING ' || to_char(sql%rowcount) ||
57: ' rows into poa_edw_rcv_txns_inc table');
58: END;
59:
60: -----------------------------------------------------------
365: SET seq_id = l_seq_id
366: WHERE seq_id IS NULL;
367:
368: p_count := sql%rowcount;
369: edw_log.put_line( 'Updated ' || p_count || ' records');
370:
371: /* Currently, 2 tables are considered for last_update_date; we may
372: need to pick more/less tables for this (DEBUG).
373: Here RCV_TRANSACTIONS is the base table for the fact */
470: EDW_COLLECTION_UTIL.g_offset);
471: g_push_to_date := NVL(l_to_date,
472: EDW_COLLECTION_UTIL.G_local_curr_push_start_date);
473:
474: edw_log.put_line( 'The collection range is from '||
475: to_char(g_push_from_date,'MM/DD/YYYY HH24:MI:SS')||' to '||
476: to_char(g_push_to_date,'MM/DD/YYYY HH24:MI:SS'));
477: edw_log.put_line(' ');
478:
473:
474: edw_log.put_line( 'The collection range is from '||
475: to_char(g_push_from_date,'MM/DD/YYYY HH24:MI:SS')||' to '||
476: to_char(g_push_to_date,'MM/DD/YYYY HH24:MI:SS'));
477: edw_log.put_line(' ');
478:
479: l_temp_date := sysdate;
480:
481: -- --------------------------------------------
480:
481: -- --------------------------------------------
482: -- Identify Change
483: -- --------------------------------------------
484: edw_log.put_line(' ');
485: edw_log.put_line('Identifying changes...');
486: l_seq_id1 := IDENTIFY_CHANGE1 (1, l_row_count);
487:
488: if (l_seq_id1 = -1) THEN
481: -- --------------------------------------------
482: -- Identify Change
483: -- --------------------------------------------
484: edw_log.put_line(' ');
485: edw_log.put_line('Identifying changes...');
486: l_seq_id1 := IDENTIFY_CHANGE1 (1, l_row_count);
487:
488: if (l_seq_id1 = -1) THEN
489: RAISE l_iden_change_failure;
487:
488: if (l_seq_id1 = -1) THEN
489: RAISE l_iden_change_failure;
490: end if;
491: edw_log.put_line('Identified ' || l_row_count || ' changed records');
492:
493: -- -------------------------------------------
494: -- Delete delicates in the Inc Table
495: -- --------------------------------------------
493: -- -------------------------------------------
494: -- Delete delicates in the Inc Table
495: -- --------------------------------------------
496: DELETE_DUPLICATES;
497: edw_log.put_line('Duplicate records deleted in Inc Table');
498:
499: -- --------------------------------------------
500: -- Push to local staging table for view type 1
501: -- --------------------------------------------
499: -- --------------------------------------------
500: -- Push to local staging table for view type 1
501: -- --------------------------------------------
502:
503: edw_log.put_line(' ');
504: edw_log.put_line('Inserting into local staging table for view type 1');
505: l_row_count1 := PUSH_TO_LOCAL(1, l_seq_id1);
506:
507: IF (l_row_count1 = -1) THEN RAISE L_push_local_failure; END IF;
500: -- Push to local staging table for view type 1
501: -- --------------------------------------------
502:
503: edw_log.put_line(' ');
504: edw_log.put_line('Inserting into local staging table for view type 1');
505: l_row_count1 := PUSH_TO_LOCAL(1, l_seq_id1);
506:
507: IF (l_row_count1 = -1) THEN RAISE L_push_local_failure; END IF;
508:
505: l_row_count1 := PUSH_TO_LOCAL(1, l_seq_id1);
506:
507: IF (l_row_count1 = -1) THEN RAISE L_push_local_failure; END IF;
508:
509: edw_log.put_line('Inserted '|| nvl(l_row_count1, 0) ||
510: ' rows into the local staging table for view type 1');
511: edw_log.put_line(' ');
512:
513: -- --------------------------------------------
507: IF (l_row_count1 = -1) THEN RAISE L_push_local_failure; END IF;
508:
509: edw_log.put_line('Inserted '|| nvl(l_row_count1, 0) ||
510: ' rows into the local staging table for view type 1');
511: edw_log.put_line(' ');
512:
513: -- --------------------------------------------
514: -- Delete all incremental tables' record
515: -- --------------------------------------------
535: end loop;
536:
537: close Invalid_Rates;
538:
539: edw_log.put_line(' ');
540: edw_log.put_line('Report created for records with Missing Rates');
541: edw_log.put_line(' ');
542:
543: -- --------------------------------------------
536:
537: close Invalid_Rates;
538:
539: edw_log.put_line(' ');
540: edw_log.put_line('Report created for records with Missing Rates');
541: edw_log.put_line(' ');
542:
543: -- --------------------------------------------
544: -- Delete records with missing rates from local staging table
537: close Invalid_Rates;
538:
539: edw_log.put_line(' ');
540: edw_log.put_line('Report created for records with Missing Rates');
541: edw_log.put_line(' ');
542:
543: -- --------------------------------------------
544: -- Delete records with missing rates from local staging table
545: -- --------------------------------------------
549: -- No exception raised so far. Call wrapup to transport
550: -- data to target database, and insert messages into logs
551: -- -----------------------------------------------
552: g_row_count := g_row_count + l_row_count1;
553: edw_log.put_line(' ');
554: edw_log.put_line('Inserted '||nvl(g_row_count,0)||
555: ' rows into the staging table');
556: l_duration := sysdate - l_temp_date;
557: edw_log.put_line(' ');
550: -- data to target database, and insert messages into logs
551: -- -----------------------------------------------
552: g_row_count := g_row_count + l_row_count1;
553: edw_log.put_line(' ');
554: edw_log.put_line('Inserted '||nvl(g_row_count,0)||
555: ' rows into the staging table');
556: l_duration := sysdate - l_temp_date;
557: edw_log.put_line(' ');
558: edw_log.put_line('Process Time: '||edw_log.duration(l_duration));
553: edw_log.put_line(' ');
554: edw_log.put_line('Inserted '||nvl(g_row_count,0)||
555: ' rows into the staging table');
556: l_duration := sysdate - l_temp_date;
557: edw_log.put_line(' ');
558: edw_log.put_line('Process Time: '||edw_log.duration(l_duration));
559: edw_log.put_line(' ');
560:
561: EDW_COLLECTION_UTIL.wrapup(TRUE, g_row_count,
554: edw_log.put_line('Inserted '||nvl(g_row_count,0)||
555: ' rows into the staging table');
556: l_duration := sysdate - l_temp_date;
557: edw_log.put_line(' ');
558: edw_log.put_line('Process Time: '||edw_log.duration(l_duration));
559: edw_log.put_line(' ');
560:
561: EDW_COLLECTION_UTIL.wrapup(TRUE, g_row_count,
562: P_PERIOD_START => g_push_from_date,
555: ' rows into the staging table');
556: l_duration := sysdate - l_temp_date;
557: edw_log.put_line(' ');
558: edw_log.put_line('Process Time: '||edw_log.duration(l_duration));
559: edw_log.put_line(' ');
560:
561: EDW_COLLECTION_UTIL.wrapup(TRUE, g_row_count,
562: P_PERIOD_START => g_push_from_date,
563: P_PERIOD_END => g_push_to_date);
573: end if;
574:
575: l_exception_msg := Retcode || ':' || Errbuf;
576: rollback; -- Rollback insert into local staging
577: edw_log.put_line('Inserting into local staging have failed');
578: EDW_COLLECTION_UTIL.wrapup(FALSE, 0, l_exception_msg,
579: g_push_from_date, g_push_to_date);
580: raise;
581:
588: end if;
589:
590: l_exception_msg := Retcode || ':' || Errbuf;
591: TRUNCATE_INC;
592: edw_log.put_line('Identifying changed records have Failed');
593: EDW_COLLECTION_UTIL.wrapup(FALSE, 0, l_exception_msg,
594: g_push_from_date, g_push_to_date);
595: raise;
596:
603: end if;
604:
605: l_exception_msg := Retcode || ':' || Errbuf;
606: rollback;
607: edw_log.put_line('Other errors');
608: EDW_COLLECTION_UTIL.wrapup(FALSE, 0, l_exception_msg,
609: g_push_from_date, g_push_to_date);
610: raise;
611: