102: x_message := err_mesg( l_error_mesg || ': ' || l_message
103: , l_proc_name
104: , l_stmt_id
105: );
106: bis_collection_utilities.put_line( x_message );
107: return c_error;
108:
109: when others then
110: x_message := err_mesg( sqlerrm, l_proc_name, l_stmt_id );
107: return c_error;
108:
109: when others then
110: x_message := err_mesg( sqlerrm, l_proc_name, l_stmt_id );
111: bis_collection_utilities.put_line( x_message );
112: return c_error;
113:
114: end check_initial_load_setup;
115:
147: 'the Depot Repair Management page.'
148: , l_func_name
149: , l_stmt_id
150: );
151: bis_collection_utilities.put_line( x_message );
152: return c_error;
153:
154: when others then
155: x_message := err_mesg( sqlerrm, l_func_name, l_stmt_id );
152: return c_error;
153:
154: when others then
155: x_message := err_mesg( sqlerrm, l_func_name, l_stmt_id );
156: bis_collection_utilities.put_line( x_message );
157: return c_error;
158:
159: end get_last_run_date;
160:
234: exception
235:
236: when l_exception then
237: x_message := l_err_msg;
238: bis_collection_utilities.put_line( x_message );
239: return c_error;
240:
241: when others then
242: x_message := err_mesg ( sqlerrm, l_func_name, l_stmt_id );
239: return c_error;
240:
241: when others then
242: x_message := err_mesg ( sqlerrm, l_func_name, l_stmt_id );
243: bis_collection_utilities.put_line( x_message );
244: return c_error;
245:
246: end get_master_organization_id;
247:
274: l_to_date date;
275:
276: begin
277:
278: bis_collection_utilities.log( 'Begin Initial Load' );
279:
280: l_stmnt_id := 0;
281: if not bis_collection_utilities.setup( g_object_name ) then
282: l_message := err_mesg( 'Error in BIS_COLLECTION_UTILITIES.Setup'
277:
278: bis_collection_utilities.log( 'Begin Initial Load' );
279:
280: l_stmnt_id := 0;
281: if not bis_collection_utilities.setup( g_object_name ) then
282: l_message := err_mesg( 'Error in BIS_COLLECTION_UTILITIES.Setup'
283: , l_proc_name
284: , l_stmnt_id
285: );
278: bis_collection_utilities.log( 'Begin Initial Load' );
279:
280: l_stmnt_id := 0;
281: if not bis_collection_utilities.setup( g_object_name ) then
282: l_message := err_mesg( 'Error in BIS_COLLECTION_UTILITIES.Setup'
283: , l_proc_name
284: , l_stmnt_id
285: );
286: bis_collection_utilities.put_line( l_message );
282: l_message := err_mesg( 'Error in BIS_COLLECTION_UTILITIES.Setup'
283: , l_proc_name
284: , l_stmnt_id
285: );
286: bis_collection_utilities.put_line( l_message );
287: raise l_exception;
288: end if;
289:
290: l_stmnt_id := 10;
294: , x_message => l_message
295: ) <> c_ok then
296: raise l_exception;
297: end if;
298: bis_collection_utilities.log( 'Global Start Date: ' || fnd_date.date_to_displaydt(g_global_start_date), 1 );
299:
300: l_stmnt_id := 20;
301: delete
302: from isc_dr_inc
301: delete
302: from isc_dr_inc
303: where fact_name = 'ISC_DR_REPAIR_ORDERS_F';
304:
305: bis_collection_utilities.log( 'Deleted from table ISC_DR_INC', 1 );
306:
307: l_stmnt_id := 30;
308: execute immediate 'TRUNCATE TABLE ' || g_isc_schema || '.ISC_DR_REPAIR_ORDERS_F';
309:
306:
307: l_stmnt_id := 30;
308: execute immediate 'TRUNCATE TABLE ' || g_isc_schema || '.ISC_DR_REPAIR_ORDERS_F';
309:
310: bis_collection_utilities.log( 'Truncated table ISC_DR_REPAIR_ORDERS_F', 1 );
311:
312: l_stmnt_id := 40;
313: l_run_date := sysdate - 5/(24*60);
314: l_to_date := sysdate;
319: , x_message => l_message
320: ) <> c_ok then
321: raise l_exception;
322: end if;
323: bis_collection_utilities.log( 'Master organization id: ' || l_master_org, 1 );
324:
325: l_stmnt_id := 60;
326: insert /*+ append parallel(isc_dr_repair_orders_f) */
327: into isc_dr_repair_orders_f
406: cr.Date_closed >= g_global_start_date
407: );
408:
409: l_rowcount := sql%rowcount;
410: bis_collection_utilities.log( 'Inserted ' || l_rowcount || ' rows into ISC_DR_REPAIR_ORDERS_F' , 1 );
411:
412: l_stmnt_id := 70;
413: insert into isc_dr_inc
414: ( fact_name
436: , l_program_application_id
437: , l_request_id
438: );
439:
440: bis_collection_utilities.log( 'Inserted into table ISC_DR_INC', 1 );
441:
442: l_stmnt_id := 80;
443: commit;
444:
442: l_stmnt_id := 80;
443: commit;
444:
445: l_stmnt_id := 90;
446: bis_collection_utilities.wrapup( p_status => true
447: , p_period_from => g_global_start_date
448: , p_period_to => l_to_date
449: , p_count => l_rowcount
450: );
450: );
451:
452: retcode := c_ok;
453:
454: bis_collection_utilities.log( 'End Initial Load' );
455:
456: exception
457:
458: when l_exception then
456: exception
457:
458: when l_exception then
459: rollback;
460: bis_collection_utilities.wrapup( p_status => false
461: , p_period_from => g_global_start_date
462: , p_period_to => l_to_date
463: , p_message => l_message
464: );
467:
468: when others then
469: rollback;
470: l_message := err_mesg( sqlerrm, l_proc_name, l_stmnt_id );
471: bis_collection_utilities.put_line( l_message );
472: bis_collection_utilities.wrapup( p_status => false
473: , p_period_from => g_global_start_date
474: , p_period_to => l_to_date
475: , p_message => l_message
468: when others then
469: rollback;
470: l_message := err_mesg( sqlerrm, l_proc_name, l_stmnt_id );
471: bis_collection_utilities.put_line( l_message );
472: bis_collection_utilities.wrapup( p_status => false
473: , p_period_from => g_global_start_date
474: , p_period_to => l_to_date
475: , p_message => l_message
476: );
510: l_to_date date;
511:
512: begin
513:
514: bis_collection_utilities.log( 'Begin Incremental Load' );
515:
516: l_stmnt_id := 0;
517: if not bis_collection_utilities.setup( g_object_name ) then
518: l_message := err_mesg( 'Error in BIS_COLLECTION_UTILITIES.Setup'
513:
514: bis_collection_utilities.log( 'Begin Incremental Load' );
515:
516: l_stmnt_id := 0;
517: if not bis_collection_utilities.setup( g_object_name ) then
518: l_message := err_mesg( 'Error in BIS_COLLECTION_UTILITIES.Setup'
519: , l_proc_name
520: , l_stmnt_id
521: );
514: bis_collection_utilities.log( 'Begin Incremental Load' );
515:
516: l_stmnt_id := 0;
517: if not bis_collection_utilities.setup( g_object_name ) then
518: l_message := err_mesg( 'Error in BIS_COLLECTION_UTILITIES.Setup'
519: , l_proc_name
520: , l_stmnt_id
521: );
522: bis_collection_utilities.put_line( l_message );
518: l_message := err_mesg( 'Error in BIS_COLLECTION_UTILITIES.Setup'
519: , l_proc_name
520: , l_stmnt_id
521: );
522: bis_collection_utilities.put_line( l_message );
523: raise l_exception;
524: end if;
525:
526: l_stmnt_id := 10;
536: l_message := 'Please run the Intial Load Request Set for the Depot Repair Management page.';
537: raise l_exception;
538: end if;
539:
540: bis_collection_utilities.log( 'From Date: ' || fnd_date.date_to_displaydt(l_last_run_date), 1 );
541:
542: l_stmnt_id := 20;
543: l_run_date := sysdate - 5/(24*60);
544: l_to_date := sysdate;
549: , x_message => l_message
550: ) <> c_ok then
551: raise l_exception;
552: end if;
553: bis_collection_utilities.log( 'Master organization id: ' || l_master_org, 1 );
554:
555: l_stmnt_id := 40;
556: merge into isc_dr_repair_orders_f fact
557: using
692: , l_request_id
693: );
694:
695: l_rowcount := sql%rowcount;
696: bis_collection_utilities.log( 'Merged ' || l_rowcount || ' rows into ISC_DR_REPAIR_ORDERS_F' , 1 );
697:
698: l_stmnt_id := 50;
699: update isc_dr_inc
700: set
707: , program_application_id = l_program_application_id
708: , request_id = l_request_id
709: where fact_name = 'ISC_DR_REPAIR_ORDERS_F';
710:
711: bis_collection_utilities.log( 'Updated into table ISC_DR_INC', 1 );
712:
713: l_stmnt_id := 60;
714: commit;
715:
713: l_stmnt_id := 60;
714: commit;
715:
716: l_stmnt_id := 70;
717: bis_collection_utilities.wrapup( p_status => true
718: , p_period_from => l_last_run_date
719: , p_period_to => l_to_date
720: , p_count => l_rowcount
721: );
721: );
722:
723: retcode := c_ok;
724:
725: bis_collection_utilities.log( 'End Incremental Load' );
726:
727: exception
728:
729: when l_exception then
727: exception
728:
729: when l_exception then
730: rollback;
731: bis_collection_utilities.wrapup( p_status => false
732: , p_period_from => l_last_run_date
733: , p_period_to => l_to_date
734: , p_message => l_message
735: );
738:
739: when others then
740: rollback;
741: l_message := err_mesg( sqlerrm, l_proc_name, l_stmnt_id );
742: bis_collection_utilities.put_line( l_message );
743: bis_collection_utilities.wrapup( p_status => false
744: , p_period_from => l_last_run_date
745: , p_period_to => l_to_date
746: , p_message => l_message
739: when others then
740: rollback;
741: l_message := err_mesg( sqlerrm, l_proc_name, l_stmnt_id );
742: bis_collection_utilities.put_line( l_message );
743: bis_collection_utilities.wrapup( p_status => false
744: , p_period_from => l_last_run_date
745: , p_period_to => l_to_date
746: , p_message => l_message
747: );