70:
71: l_last_migration_date := to_date(p_last_migration_date, 'YYYY/MM/DD HH24:MI:SS');
72: -- initialize messaging
73: if p_concurrent_process = 'Y' then
74: ben_dm_utility.message_init;
75: end if;
76:
77: ben_dm_utility.message('ROUT','entry:'||l_proc , 5);
78: ben_dm_utility.message('PARA','(errbuf - ' || errbuf ||
73: if p_concurrent_process = 'Y' then
74: ben_dm_utility.message_init;
75: end if;
76:
77: ben_dm_utility.message('ROUT','entry:'||l_proc , 5);
78: ben_dm_utility.message('PARA','(errbuf - ' || errbuf ||
79: ')(retcode - ' || retcode ||
80: ')(p_migration_id - ' || p_migration_id ||
81: ')(p_concurrent_process - ' || p_concurrent_process ||
74: ben_dm_utility.message_init;
75: end if;
76:
77: ben_dm_utility.message('ROUT','entry:'||l_proc , 5);
78: ben_dm_utility.message('PARA','(errbuf - ' || errbuf ||
79: ')(retcode - ' || retcode ||
80: ')(p_migration_id - ' || p_migration_id ||
81: ')(p_concurrent_process - ' || p_concurrent_process ||
82: ')(p_last_migration_date - '|| l_last_migration_date ||
81: ')(p_concurrent_process - ' || p_concurrent_process ||
82: ')(p_last_migration_date - '|| l_last_migration_date ||
83: ')', 10);
84:
85: l_no_of_threads := ben_dm_utility.number_of_threads(p_business_group_id);
86:
87: -- assign the default to 3
88: if l_no_of_threads is null then
89: l_no_of_threads := 3 ;
100: -- get status of generate phase. If phase has error status set by other slave
101: -- process then we need to stop the processing of this slave.
102: -- if null returned, then assume it is not started.
103: --
104: l_current_phase_status := nvl(ben_dm_utility.get_phase_status('G',p_migration_id), 'NS');
105:
106: -- if status is error, then raise an exception
107: if (l_current_phase_status = 'E') then
108: l_fatal_error_message := 'Encountered error in generator phase caused by ' ||
118: end if;
119: close csr_get_table;
120:
121: -- update status to started
122: ben_dm_utility.update_phase_items(p_new_status => 'S',
123: p_id => l_csr_get_table_rec.phase_item_id);
124:
125: l_phase_item_id := l_csr_get_table_rec.phase_item_id;
126: l_phase_id := l_csr_get_table_rec.phase_id;
125: l_phase_item_id := l_csr_get_table_rec.phase_item_id;
126: l_phase_id := l_csr_get_table_rec.phase_id;
127:
128:
129: ben_dm_utility.message('INFO','Started Generating TUPS/TDS for ' ||
130: l_csr_get_table_rec.table_name || ', Table Id - ' ||
131: l_csr_get_table_rec.table_id,20);
132:
133: ben_dm_utility.message('SUMM','Started Generating TUPS/TDS for ' ||
129: ben_dm_utility.message('INFO','Started Generating TUPS/TDS for ' ||
130: l_csr_get_table_rec.table_name || ', Table Id - ' ||
131: l_csr_get_table_rec.table_id,20);
132:
133: ben_dm_utility.message('SUMM','Started Generating TUPS/TDS for ' ||
134: l_csr_get_table_rec.table_name || ', Table Id - ' ||
135: l_csr_get_table_rec.table_id,30);
136: --
137: -- Call TUPS genrator to create TUPS for the table
136: --
137: -- Call TUPS genrator to create TUPS for the table
138: --
139: hr_utility.set_location('Calling Upload for :'||l_csr_get_table_rec.table_alias , 40);
140: ben_dm_utility.message('INFO',' Started Generating TUPS for ' ||
141: l_csr_get_table_rec.table_name,50);
142:
143: BEN_DM_GEN_UPLOAD.main (
144: p_table_alias => l_csr_get_table_rec.table_alias ,
145: p_migration_id => p_migration_id
146: );
147:
148:
149: ben_dm_utility.message('INFO',' Successfully Generated TUPS for ' ||
150: l_csr_get_table_rec.table_name,60);
151: --
152: --
153: -- Call TDS generator to create TDS for the table
151: --
152: --
153: -- Call TDS generator to create TDS for the table
154: --
155: ben_dm_utility.message('INFO',' Started Generating TDS for ' ||
156: l_csr_get_table_rec.table_name,70);
157:
158: hr_utility.set_location('Calling Download for :'||l_csr_get_table_rec.table_alias , 10);
159:
174: generator_version = l_generator_version
175: where table_id = l_csr_get_table_rec.table_id;
176:
177: -- update status to completed
178: ben_dm_utility.update_phase_items(p_new_status => 'C',
179: p_id => l_phase_item_id);
180:
181: ben_dm_utility.message('INFO','Generated TUPS/TDS succesfully for ' ||
182: l_csr_get_table_rec.table_name || ', Table Id - ' ||
177: -- update status to completed
178: ben_dm_utility.update_phase_items(p_new_status => 'C',
179: p_id => l_phase_item_id);
180:
181: ben_dm_utility.message('INFO','Generated TUPS/TDS succesfully for ' ||
182: l_csr_get_table_rec.table_name || ', Table Id - ' ||
183: l_csr_get_table_rec.table_id,110);
184:
185: ben_dm_utility.message('SUMM','Generated TUPS/TDS successfully for ' ||
181: ben_dm_utility.message('INFO','Generated TUPS/TDS succesfully for ' ||
182: l_csr_get_table_rec.table_name || ', Table Id - ' ||
183: l_csr_get_table_rec.table_id,110);
184:
185: ben_dm_utility.message('SUMM','Generated TUPS/TDS successfully for ' ||
186: l_csr_get_table_rec.table_name || ', Table Id - ' ||
187: l_csr_get_table_rec.table_id,120);
188:
189: end loop;
191: -- when the process number is one call for generating self reference
192: -- package
193: if p_process_number = 1 then
194:
195: ben_dm_utility.message('INFO',' Started Generating ben_dm_resolve_reference ' ,130);
196: BEN_DM_GEN_SELF_REF.main( p_business_group_id => p_business_group_id ,
197: p_migration_id => p_migration_id
198: ) ;
199: ben_dm_utility.message('INFO',' Generated ben_dm_resolve_reference ' ,140);
195: ben_dm_utility.message('INFO',' Started Generating ben_dm_resolve_reference ' ,130);
196: BEN_DM_GEN_SELF_REF.main( p_business_group_id => p_business_group_id ,
197: p_migration_id => p_migration_id
198: ) ;
199: ben_dm_utility.message('INFO',' Generated ben_dm_resolve_reference ' ,140);
200: end if ;
201: */
202:
203: -- set up return values to concurrent manager
203: -- set up return values to concurrent manager
204: retcode := 0;
205: errbuf := 'No errors - examine logfiles for detailed reports.';
206:
207: ben_dm_utility.message('ROUT','exit:' || l_proc , 150);
208: hr_utility.set_location('Leaving:'||l_proc, 10);
209: -- error handling
210: exception
211: when e_fatal_error then
213: close csr_get_table;
214: end if;
215: retcode := 2;
216: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
217: ben_dm_utility.error(SQLCODE,l_proc , l_fatal_error_message,'R');
218:
219: -- if the error is caused because the other process has set the generator phase to 'Error'
220: -- then the phase_item_id is 'NULL' , otherwise, the error is caused within this process
221: -- while generating TUPS/TDS.
220: -- then the phase_item_id is 'NULL' , otherwise, the error is caused within this process
221: -- while generating TUPS/TDS.
222:
223: if l_phase_item_id is not null then
224: ben_dm_utility.update_phase_items(p_new_status => 'E',
225: p_id => l_phase_item_id);
226: else
227: ben_dm_utility.update_phases(p_new_status => 'E',
228: p_id => l_phase_id);
223: if l_phase_item_id is not null then
224: ben_dm_utility.update_phase_items(p_new_status => 'E',
225: p_id => l_phase_item_id);
226: else
227: ben_dm_utility.update_phases(p_new_status => 'E',
228: p_id => l_phase_id);
229: end if;
230:
231: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
227: ben_dm_utility.update_phases(p_new_status => 'E',
228: p_id => l_phase_id);
229: end if;
230:
231: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
232: when e_fatal_error2 then
233: if csr_get_table%isopen then
234: close csr_get_table;
235: end if;
234: close csr_get_table;
235: end if;
236: retcode := 0;
237: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
238: ben_dm_utility.error(SQLCODE,l_proc , l_fatal_error_message,'R');
239:
240: -- if the error is caused because the other process has set the generator phase to 'Error'
241: -- then the phase_item_id is 'NULL' , otherwise, the error is caused within this process
242: -- while generating TUPS/TDS.
241: -- then the phase_item_id is 'NULL' , otherwise, the error is caused within this process
242: -- while generating TUPS/TDS.
243:
244: if l_phase_item_id is not null then
245: ben_dm_utility.update_phase_items(p_new_status => 'E',
246: p_id => l_phase_item_id);
247: else
248: ben_dm_utility.update_phases(p_new_status => 'E',
249: p_id => l_phase_id);
244: if l_phase_item_id is not null then
245: ben_dm_utility.update_phase_items(p_new_status => 'E',
246: p_id => l_phase_item_id);
247: else
248: ben_dm_utility.update_phases(p_new_status => 'E',
249: p_id => l_phase_id);
250: end if;
251:
252: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
248: ben_dm_utility.update_phases(p_new_status => 'E',
249: p_id => l_phase_id);
250: end if;
251:
252: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
253: when others then
254: if csr_get_table%isopen then
255: close csr_get_table;
256: end if;
256: end if;
257: retcode := 2;
258: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
259: -- update status to error
260: ben_dm_utility.update_phase_items(p_new_status => 'E',
261: p_id => l_phase_item_id);
262: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
263:
264:
258: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
259: -- update status to error
260: ben_dm_utility.update_phase_items(p_new_status => 'E',
261: p_id => l_phase_item_id);
262: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
263:
264:
265: end main_generator ;
266:
344: l_pre_fix := 'BEN_DMD' ;
345: l_last_migration_date := to_date(p_last_migration_date, 'YYYY/MM/DD HH24:MI:SS');
346: -- initialize messaging
347: if p_concurrent_process = 'Y' then
348: ben_dm_utility.message_init;
349: end if;
350:
351: --open file handler
352: g_file_handle := utl_file.fopen(p_dir_name,p_file_name||'.'||p_process_number,'w',l_max_ext);
350:
351: --open file handler
352: g_file_handle := utl_file.fopen(p_dir_name,p_file_name||'.'||p_process_number,'w',l_max_ext);
353:
354: ben_dm_utility.message('ROUT','entry:'||l_proc , 5);
355: ben_dm_utility.message('PARA','(errbuf - ' || errbuf ||
356: ')(retcode - ' || retcode ||
357: ')(p_migration_id - ' || p_migration_id ||
358: ')(p_concurrent_process - ' || p_concurrent_process ||
351: --open file handler
352: g_file_handle := utl_file.fopen(p_dir_name,p_file_name||'.'||p_process_number,'w',l_max_ext);
353:
354: ben_dm_utility.message('ROUT','entry:'||l_proc , 5);
355: ben_dm_utility.message('PARA','(errbuf - ' || errbuf ||
356: ')(retcode - ' || retcode ||
357: ')(p_migration_id - ' || p_migration_id ||
358: ')(p_concurrent_process - ' || p_concurrent_process ||
359: ')(p_last_migration_date - '|| l_last_migration_date ||
360: ')(p_process_number - ' || p_process_number ||
361: ')(p_business_group_id - '|| p_business_group_id ||
362: ')', 10);
363:
364: l_no_of_threads := ben_dm_utility.number_of_threads(p_business_group_id);
365: -- assign the default to 3
366: if l_no_of_threads is null then
367: l_no_of_threads := 3 ;
368: end if ;
383: -- get status of generate phase. If phase has error status set by other slave
384: -- process then we need to stop the processing of this slave.
385: -- if null returned, then assume it is not started.
386: --
387: l_current_phase_status := nvl(ben_dm_utility.get_phase_status('DP',p_migration_id), 'NS');
388:
389: -- if status is error, then raise an exception
390: if (l_current_phase_status = 'E') then
391: l_fatal_error_message := 'Encountered error in download phase caused by ' ||
403: open c_bg(l_input_file_rec.source_business_group_name) ;
404: fetch c_bg into l_business_group_id ;
405: close c_bg ;
406:
407: ben_dm_utility.message('INFO','Source Business Group ID :'||l_business_group_id , 30);
408:
409: if l_business_group_id is null then
410: l_fatal_error_message := 'Encountered error in download Source Business Group ' || l_input_file_rec.SOURCE_BUSINESS_GROUP_NAME || ' not found ! ';
411: raise e_fatal_error2;
411: raise e_fatal_error2;
412: end if ;
413:
414: -- update status to started
415: ben_dm_utility.update_phase_items(p_new_status => 'S',
416: p_id => l_phase_item_id);
417:
418:
419: ben_dm_utility.message('INFO','Started download data for ' ||
415: ben_dm_utility.update_phase_items(p_new_status => 'S',
416: p_id => l_phase_item_id);
417:
418:
419: ben_dm_utility.message('INFO','Started download data for ' ||
420: l_input_file_rec.source_person_id || ', SSN - ' ||
421: l_input_file_rec.SOURCE_NATIONAL_IDENTIFIER,40);
422:
423: ben_dm_utility.message('SUMM','Started download data for ' ||
419: ben_dm_utility.message('INFO','Started download data for ' ||
420: l_input_file_rec.source_person_id || ', SSN - ' ||
421: l_input_file_rec.SOURCE_NATIONAL_IDENTIFIER,40);
422:
423: ben_dm_utility.message('SUMM','Started download data for ' ||
424: l_input_file_rec.source_person_id || ', SSN - ' ||
425: l_input_file_rec.SOURCE_NATIONAL_IDENTIFIER,50);
426:
427:
436: lstring := lstring || ',p_person_id => :4 ' ;
437: lstring := lstring || ',p_group_order => :5 ' ;
438: lstring := lstring || ',p_rec_downloaded => :6 ) ; END ; ' ;
439:
440: ben_dm_utility.message('INFO','calling download procedure :'||l_pre_fix||t_tab_short_name(i)||'.DOWNALOAD' , 5);
441:
442: begin
443: execute immediate lstring using
444: p_migration_id,
448: l_input_file_rec.group_order ,
449: OUT l_rec_downloaded ;
450: exception
451: when others then
452: ben_dm_utility.message('INFO','calling download procedure SQL error ' , 60);
453: ben_dm_utility.message('INFO', substr(sqlerrm,1,150) , 60);
454: l_fatal_error_message := 'Encountered error in download phase caused by ' || t_tab_short_name(i) ;
455: raise e_fatal_error2;
456:
449: OUT l_rec_downloaded ;
450: exception
451: when others then
452: ben_dm_utility.message('INFO','calling download procedure SQL error ' , 60);
453: ben_dm_utility.message('INFO', substr(sqlerrm,1,150) , 60);
454: l_fatal_error_message := 'Encountered error in download phase caused by ' || t_tab_short_name(i) ;
455: raise e_fatal_error2;
456:
457: end;
454: l_fatal_error_message := 'Encountered error in download phase caused by ' || t_tab_short_name(i) ;
455: raise e_fatal_error2;
456:
457: end;
458: ben_dm_utility.message('INFO','download completed for :'||t_tab_short_name(i) , 70);
459:
460: end loop ;
461:
462: ben_dm_utility.update_phase_items(p_new_status => 'C',
458: ben_dm_utility.message('INFO','download completed for :'||t_tab_short_name(i) , 70);
459:
460: end loop ;
461:
462: ben_dm_utility.update_phase_items(p_new_status => 'C',
463: p_id => l_phase_item_id);
464:
465: ben_dm_utility.message('INFO','Downloaded succesfully for ' ||
466: l_input_file_rec.source_person_id || ', SSN - ' ||
461:
462: ben_dm_utility.update_phase_items(p_new_status => 'C',
463: p_id => l_phase_item_id);
464:
465: ben_dm_utility.message('INFO','Downloaded succesfully for ' ||
466: l_input_file_rec.source_person_id || ', SSN - ' ||
467: l_input_file_rec.SOURCE_NATIONAL_IDENTIFIER,80);
468:
469:
466: l_input_file_rec.source_person_id || ', SSN - ' ||
467: l_input_file_rec.SOURCE_NATIONAL_IDENTIFIER,80);
468:
469:
470: ben_dm_utility.message('SUMM','Downloaded succesfully for ' ||
471: l_input_file_rec.source_person_id || ', SSN - ' ||
472: l_input_file_rec.SOURCE_NATIONAL_IDENTIFIER,90);
473:
474: End Loop ;
473:
474: End Loop ;
475: hr_general.g_data_migrator_mode := 'N';
476: hr_utility.set_location('Leaving:'||l_proc, 10);
477: ben_dm_utility.message('ROUT','EXIT ' || l_proc ,100);
478: Exception
479:
480: when e_fatal_error2 then
481: hr_general.g_data_migrator_mode := 'N';
480: when e_fatal_error2 then
481: hr_general.g_data_migrator_mode := 'N';
482: retcode := 0;
483: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
484: ben_dm_utility.error(SQLCODE,l_proc , l_fatal_error_message,'R');
485:
486: if l_phase_item_id is not null then
487: ben_dm_utility.update_phase_items(p_new_status => 'E',
488: p_id => l_phase_item_id);
483: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
484: ben_dm_utility.error(SQLCODE,l_proc , l_fatal_error_message,'R');
485:
486: if l_phase_item_id is not null then
487: ben_dm_utility.update_phase_items(p_new_status => 'E',
488: p_id => l_phase_item_id);
489: end if;
490:
491: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
487: ben_dm_utility.update_phase_items(p_new_status => 'E',
488: p_id => l_phase_item_id);
489: end if;
490:
491: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
492: when others then
493: hr_general.g_data_migrator_mode := 'N';
494: retcode := 2;
495: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
493: hr_general.g_data_migrator_mode := 'N';
494: retcode := 2;
495: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
496: -- update status to error
497: ben_dm_utility.update_phase_items(p_new_status => 'E',
498: p_id => l_phase_item_id);
499: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
500:
501: end download ;
495: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
496: -- update status to error
497: ben_dm_utility.update_phase_items(p_new_status => 'E',
498: p_id => l_phase_item_id);
499: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
500:
501: end download ;
502:
503: Procedure upload
578: l_pre_fix := 'BEN_DMU' ;
579: l_last_migration_date := to_date(p_last_migration_date, 'YYYY/MM/DD HH24:MI:SS');
580: -- initialize messaging
581: if p_concurrent_process = 'Y' then
582: ben_dm_utility.message_init;
583: end if;
584:
585: ben_dm_utility.message('ROUT','entry:'||l_proc , 5);
586: ben_dm_utility.message('PARA','(errbuf - ' || errbuf ||
581: if p_concurrent_process = 'Y' then
582: ben_dm_utility.message_init;
583: end if;
584:
585: ben_dm_utility.message('ROUT','entry:'||l_proc , 5);
586: ben_dm_utility.message('PARA','(errbuf - ' || errbuf ||
587: ')(retcode - ' || retcode ||
588: ')(p_migration_id - ' || p_migration_id ||
589: ')(p_concurrent_process - ' || p_concurrent_process ||
582: ben_dm_utility.message_init;
583: end if;
584:
585: ben_dm_utility.message('ROUT','entry:'||l_proc , 5);
586: ben_dm_utility.message('PARA','(errbuf - ' || errbuf ||
587: ')(retcode - ' || retcode ||
588: ')(p_migration_id - ' || p_migration_id ||
589: ')(p_concurrent_process - ' || p_concurrent_process ||
590: ')(p_last_migration_date - '|| l_last_migration_date ||
589: ')(p_concurrent_process - ' || p_concurrent_process ||
590: ')(p_last_migration_date - '|| l_last_migration_date ||
591: ')', 10);
592:
593: l_no_of_threads := ben_dm_utility.number_of_threads(p_business_group_id);
594: -- assign the default to 3
595: if l_no_of_threads is null then
596: l_no_of_threads := 3 ;
597: end if ;
604: close csr_get_table;
605:
606: ben_dm_data_util.create_fk_cache ;
607:
608: ben_dm_utility.g_out_file_handle := utl_file.fopen(p_dir_name,p_file_name||'.out'||p_process_number,'w',l_max_ext);
609: ---
610: loop
611: l_phase_item_id := NULL;
612:
614: -- get status of generate phase. If phase has error status set by other slave
615: -- process then we need to stop the processing of this slave.
616: -- if null returned, then assume it is not started.
617: --
618: l_current_phase_status := nvl(ben_dm_utility.get_phase_status('UP',p_migration_id), 'NS');
619: ben_dm_utility.message('INFO',' current phase status ' || l_current_phase_status,70);
620:
621: -- if status is error, then raise an exception
622: if (l_current_phase_status = 'E') then
615: -- process then we need to stop the processing of this slave.
616: -- if null returned, then assume it is not started.
617: --
618: l_current_phase_status := nvl(ben_dm_utility.get_phase_status('UP',p_migration_id), 'NS');
619: ben_dm_utility.message('INFO',' current phase status ' || l_current_phase_status,70);
620:
621: -- if status is error, then raise an exception
622: if (l_current_phase_status = 'E') then
623: l_fatal_error_message := 'Encountered error in download phase caused by ' ||
628: open c_phase;
629: fetch c_phase into l_phase_rec ;
630: if c_phase%notfound then
631: close c_phase;
632: ben_dm_utility.message('INFO','exit without phase data :'||l_proc , 20);
633: exit;
634: end if;
635: close c_phase;
636:
634: end if;
635: close c_phase;
636:
637:
638: ben_dm_utility.message('INFO',' group order ' || l_phase_rec.group_order,70);
639:
640: -- update status to started
641: ben_dm_utility.update_phase_items(p_new_status => 'S',
642: p_id => l_phase_rec.phase_item_id);
637:
638: ben_dm_utility.message('INFO',' group order ' || l_phase_rec.group_order,70);
639:
640: -- update status to started
641: ben_dm_utility.update_phase_items(p_new_status => 'S',
642: p_id => l_phase_rec.phase_item_id);
643:
644: l_phase_item_id := l_phase_rec.phase_item_id;
645: l_phase_id := l_phase_rec.phase_id;
657: -- group order for for every target bg is unique
658: open c_bg(l_input_file_rec.target_business_group_name) ;
659: fetch c_bg into l_business_group_id ;
660: close c_bg ;
661: ben_dm_utility.message('INFO','Business Group ID :'||l_business_group_id , 30);
662: if l_business_group_id is null then
663: l_fatal_error_message := 'Encountered error in upload target Business Group '
664: ||l_input_file_rec.TARGET_BUSINESS_GROUP_NAME || ' not found ! ';
665: raise e_fatal_error2;
667:
668:
669: hr_utility.set_location(' starting ' || l_input_file_rec.group_order , 99 ) ;
670:
671: ben_dm_utility.message('INFO','Started upload data for ' ||
672: l_input_file_rec.group_order || ', Group - BG ' ||
673: l_input_file_rec.target_business_group_name,40);
674:
675: ben_dm_utility.message('SUMM','Started upload data for ' ||
671: ben_dm_utility.message('INFO','Started upload data for ' ||
672: l_input_file_rec.group_order || ', Group - BG ' ||
673: l_input_file_rec.target_business_group_name,40);
674:
675: ben_dm_utility.message('SUMM','Started upload data for ' ||
676: l_input_file_rec.group_order || ', SSN - BG ' ||
677: l_input_file_rec.target_business_group_name,50);
678:
679:
681: for i in 1..t_tab_short_name.count
682: Loop
683:
684: hr_utility.set_location(' building sql for ' || t_tab_short_name(i), 99 ) ;
685: ben_dm_utility.message('INFO',' Building SQL for ' || t_tab_short_name(i),70);
686:
687: lstring := 'Begin ' || l_pre_fix||t_tab_short_name(i)||'.UPLOAD(' ;
688: lstring := lstring || 'p_migration_id => :1 ' ;
689: lstring := lstring || ',p_business_group_id => :2 ' ;
693: lstring := lstring || ' ) ; END ; ' ;
694:
695:
696: hr_utility.set_location(' executing sql for ' || t_tab_short_name(i), 99 ) ;
697: ben_dm_utility.message('INFO',' Executing ' || t_tab_short_name(i),70);
698: begin
699: execute immediate lstring using
700: p_migration_id ,
701: l_business_group_id,
703: l_input_file_rec.group_order,
704: p_delimiter ;
705: exception
706: when others then
707: ben_dm_utility.message('INFO','calling upload procedure SQL error ' , 60);
708: ben_dm_utility.message('INFO', substr(sqlerrm,1,150) , 60);
709: l_fatal_error_message := 'Encountered error in upload phase caused by ' ||
710: t_tab_short_name(i) ;
711: raise e_fatal_error2;
704: p_delimiter ;
705: exception
706: when others then
707: ben_dm_utility.message('INFO','calling upload procedure SQL error ' , 60);
708: ben_dm_utility.message('INFO', substr(sqlerrm,1,150) , 60);
709: l_fatal_error_message := 'Encountered error in upload phase caused by ' ||
710: t_tab_short_name(i) ;
711: raise e_fatal_error2;
712:
712:
713: end;
714:
715: hr_utility.set_location(' upload completed for ' || t_tab_short_name(i), 99 ) ;
716: ben_dm_utility.message('INFO',' Upload Completed for ' || t_tab_short_name(i),70);
717:
718: end loop ;
719:
720:
721: /*
722:
723: -- call this for every order once , if the order changed to loop , move below the loop
724: hr_utility.set_location(' upload completed for ' || l_input_file_rec.group_order , 99 ) ;
725: ben_dm_utility.message('INFO','Call for Self reference :'||l_phase_rec.group_order , 60);
726:
727: lstring := 'Begin ben_dm_resolve_reference.main( ' ;
728: lstring := lstring || 'p_migration_id => :1 ' ;
729: lstring := lstring || ',p_business_group_name => :2 ' ;
735: l_business_group_id,
736: l_input_file_rec.group_order ;
737: exception
738: when others then
739: ben_dm_utility.message('INFO','calling procedure ben_dm_resolve_reference error ' , 60);
740: ben_dm_utility.message('INFO', substr(sqlerrm,1,150) , 60);
741: l_fatal_error_message := 'Encountered error caused by ben_dm_resolve_reference error ' ;
742: raise e_fatal_error2;
743:
736: l_input_file_rec.group_order ;
737: exception
738: when others then
739: ben_dm_utility.message('INFO','calling procedure ben_dm_resolve_reference error ' , 60);
740: ben_dm_utility.message('INFO', substr(sqlerrm,1,150) , 60);
741: l_fatal_error_message := 'Encountered error caused by ben_dm_resolve_reference error ' ;
742: raise e_fatal_error2;
743:
744: end;
745: */
746: End if ;
747:
748:
749: ben_dm_utility.update_phase_items(p_new_status => 'C',
750: p_id => l_phase_item_id);
751:
752: -- clear the cache for every group order
753: ben_dm_data_util.g_pk_maping_tbl.delete ;
754:
755:
756: hr_utility.set_location(' download completed for ' || l_phase_rec.group_order , 99 ) ;
757:
758: ben_dm_utility.message('INFO','Uploded succesfully for ' || l_phase_rec.group_order,70);
759:
760:
761:
762: ben_dm_utility.message('SUMM','Uploded succesfully for ' ||
758: ben_dm_utility.message('INFO','Uploded succesfully for ' || l_phase_rec.group_order,70);
759:
760:
761:
762: ben_dm_utility.message('SUMM','Uploded succesfully for ' ||
763: l_phase_rec.group_order,80);
764:
765:
766: End Loop ;
767:
768: -- clear the fk cache
769: ben_dm_data_util.g_fk_maping_tbl.delete ;
770:
771: ben_dm_utility.message('ROUT','EXIT ' || l_proc,100);
772: hr_general.g_data_migrator_mode := 'N';
773: hr_utility.set_location('Leaving:'||l_proc, 10);
774: Exception
775: when e_fatal_error2 then
775: when e_fatal_error2 then
776: hr_general.g_data_migrator_mode := 'N';
777: retcode := 0;
778: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
779: ben_dm_utility.error(SQLCODE,l_proc , l_fatal_error_message,'R');
780:
781: if l_phase_item_id is not null then
782: ben_dm_utility.update_phase_items(p_new_status => 'E',
783: p_id => l_phase_item_id);
778: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
779: ben_dm_utility.error(SQLCODE,l_proc , l_fatal_error_message,'R');
780:
781: if l_phase_item_id is not null then
782: ben_dm_utility.update_phase_items(p_new_status => 'E',
783: p_id => l_phase_item_id);
784: else
785: ben_dm_utility.update_phases(p_new_status => 'E',
786: p_id => l_phase_id);
781: if l_phase_item_id is not null then
782: ben_dm_utility.update_phase_items(p_new_status => 'E',
783: p_id => l_phase_item_id);
784: else
785: ben_dm_utility.update_phases(p_new_status => 'E',
786: p_id => l_phase_id);
787: end if;
788:
789: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
785: ben_dm_utility.update_phases(p_new_status => 'E',
786: p_id => l_phase_id);
787: end if;
788:
789: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
790: when others then
791: hr_general.g_data_migrator_mode := 'N';
792: retcode := 2;
793: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
791: hr_general.g_data_migrator_mode := 'N';
792: retcode := 2;
793: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
794: -- update status to error
795: ben_dm_utility.update_phase_items(p_new_status => 'E',
796: p_id => l_phase_item_id);
797: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
798:
799: end upload ;
793: errbuf := 'An error occurred during the migration - examine logfiles for detailed reports.';
794: -- update status to error
795: ben_dm_utility.update_phase_items(p_new_status => 'E',
796: p_id => l_phase_item_id);
797: ben_dm_utility.error(SQLCODE,l_proc,'(none)','R');
798:
799: end upload ;
800:
801: