[Home] [Help]
PACKAGE BODY: APPS.HR_DM_AOL_DOWN
Source
1 PACKAGE BODY hr_dm_aol_down AS
2 /* $Header: perdmadl.pkb 120.0 2005/05/31 17:03:06 appldev noship $ */
3
4
5 /*--------------------------- PRIVATE ROUTINES --------------------------*/
6
7
8
9 -- ------------------------- spawn_down ------------------------
10 -- Description: The parameters for the requested loader are set up and a
11 -- slave is spawned via spawn_slave.
12 --
13 --
14 -- Input Parameters
15 -- p_migration_id - migration id
16 --
17 -- p_phase_id - of phase
18 --
19 -- p_phase_item - of phase item
20 --
21 --
22 --
23 --
24 -- Output Parameters
25 -- <none>
26 --
27 --
28 -- ------------------------------------------------------------------------
29
30
31
32 --
33 PROCEDURE spawn_down(p_migration_id IN NUMBER,
34 p_phase_id IN NUMBER,
35 p_phase_item_id IN NUMBER
36 ) IS
37 --
38
39 l_loader_name VARCHAR2(30);
40 l_loader_conc_program VARCHAR2(30);
41 l_loader_config_file VARCHAR2(30);
42 l_config VARCHAR2(100);
43 l_selective VARCHAR2(2000);
44 l_parameter1 VARCHAR2(100);
45 l_parameter2 VARCHAR2(100);
46 l_parameter3 VARCHAR2(100);
47 l_parameter4 VARCHAR2(100);
48 l_parameter5 VARCHAR2(100);
49 l_parameter6 VARCHAR2(100);
50 l_parameter7 VARCHAR2(100);
51 l_parameter8 VARCHAR2(100);
52 l_parameter9 VARCHAR2(100);
53 l_parameter10 VARCHAR2(100);
54 l_loader_application VARCHAR2(50);
55 l_application_id NUMBER;
56 l_program VARCHAR2(30);
57 e_fatal_error EXCEPTION;
58 l_fatal_error_message VARCHAR2(200);
59 l_filename VARCHAR2(50);
60 l_request_id NUMBER;
61 l_env_var VARCHAR2(30);
62 l_migration_type VARCHAR2(30);
63 l_selective_migration_criteria VARCHAR2(2000);
64 l_aol_command VARCHAR2(2000);
65 l_source_database VARCHAR2(30);
66 l_business_group_id NUMBER;
67 l_security_group VARCHAR2(30);
68
69 CURSOR csr_data IS
70 SELECT lpi.loader_name,
71 lpi.loader_conc_program,
72 lpi.loader_config_file,
73 lpi.loader_application,
74 lpi.parameter_1, lpi.parameter_2,
75 lpi.parameter_3, lpi.parameter_4,
76 lpi.parameter_5, lpi.parameter_6,
77 lpi.parameter_7, lpi.parameter_8,
78 lpi.parameter_9, lpi.parameter_10,
79 lpi.application_id,
80 lpi.filename
81 FROM hr_dm_loader_phase_items lpi,
82 hr_dm_phase_items pi
83 WHERE (pi.phase_item_id = p_phase_item_id)
84 AND (lpi.da_phase_item_id = pi.phase_item_id);
85
86 CURSOR csr_migration_info IS
87 SELECT dm.migration_type,
88 dm.selective_migration_criteria,
89 dm.business_group_id,
90 sg.security_group_key
91 FROM hr_dm_migrations dm,
92 fnd_security_groups sg,
93 per_business_groups pbg
94 WHERE dm.migration_id = p_migration_id
95 AND dm.business_group_id = pbg.business_group_id
96 AND pbg.security_group_id = sg.security_group_id;
97
98
99 --
100 BEGIN
101 --
102
103 hr_dm_utility.message('ROUT','entry:hr_dm_aol_down.spawn_down', 5);
104 hr_dm_utility.message('PARA','(p_migration_id - ' || p_migration_id ||
105 '(p_phase_id - ' || p_phase_id ||
106 '(p_phase_item_id - ' || p_phase_item_id ||
107 ')',10);
108
109
110 -- get data for current phase_item_id
111 OPEN csr_data;
112 FETCH csr_data INTO l_loader_name,
113 l_loader_conc_program,
114 l_loader_config_file,
115 l_loader_application,
116 l_parameter1, l_parameter2,
117 l_parameter3, l_parameter4,
118 l_parameter5, l_parameter6,
119 l_parameter7, l_parameter8,
120 l_parameter9, l_parameter10,
121 l_application_id,
122 l_filename;
123 IF (csr_data%NOTFOUND) THEN
124 l_fatal_error_message := 'Unable to find loader configuration data.';
125 RAISE e_fatal_error;
126 END IF;
127 CLOSE csr_data;
128
129 COMMIT;
130
131
132 -- set up local data
133 l_program := 'HRDMSLVA';
134 IF (l_loader_conc_program = 'FNDLOAD') THEN
135 l_program := l_program || 'G';
136 ELSIF (l_loader_conc_program = 'FNDSLOAD') THEN
137 l_program := l_program || 'S';
138 END IF;
139
140
141 -- find the parameter with the :mode and replace with 'DOWNLOAD'
142 IF (l_parameter1 = ':mode') THEN l_parameter1 := 'DOWNLOAD';
143 ELSIF (l_parameter2 = ':mode') THEN l_parameter2 := 'DOWNLOAD';
144 ELSIF (l_parameter3 = ':mode') THEN l_parameter3 := 'DOWNLOAD';
145 ELSIF (l_parameter4 = ':mode') THEN l_parameter4 := 'DOWNLOAD';
146 ELSIF (l_parameter5 = ':mode') THEN l_parameter5 := 'DOWNLOAD';
147 ELSIF (l_parameter6 = ':mode') THEN l_parameter6 := 'DOWNLOAD';
148 ELSIF (l_parameter7 = ':mode') THEN l_parameter7 := 'DOWNLOAD';
149 ELSIF (l_parameter8 = ':mode') THEN l_parameter8 := 'DOWNLOAD';
150 ELSIF (l_parameter9 = ':mode') THEN l_parameter9 := 'DOWNLOAD';
151 ELSIF (l_parameter10 = ':mode') THEN l_parameter10 := 'DOWNLOAD';
152 END IF;
153
154 -- find the parameter with the :config and replace with the path
155 -- and config file filename
156 l_config := '@fnd:patch/115/import/' || l_loader_config_file;
157
158 IF (l_parameter1 = ':config') THEN l_parameter1 := l_config;
159 ELSIF (l_parameter2 = ':config') THEN l_parameter2 := l_config;
160 ELSIF (l_parameter3 = ':config') THEN l_parameter3 := l_config;
161 ELSIF (l_parameter4 = ':config') THEN l_parameter4 := l_config;
162 ELSIF (l_parameter5 = ':config') THEN l_parameter5 := l_config;
163 ELSIF (l_parameter6 = ':config') THEN l_parameter6 := l_config;
164 ELSIF (l_parameter7 = ':config') THEN l_parameter7 := l_config;
165 ELSIF (l_parameter8 = ':config') THEN l_parameter8 := l_config;
166 ELSIF (l_parameter9 = ':config') THEN l_parameter9 := l_config;
167 ELSIF (l_parameter10 = ':config') THEN l_parameter10 := l_config;
168 END IF;
169
170
171 -- find the data file and replace with the path and filename
172
173 IF (l_parameter1 = ':data') THEN l_parameter1 := l_filename;
174 ELSIF (l_parameter2 = ':data') THEN l_parameter2 := l_filename;
175 ELSIF (l_parameter3 = ':data') THEN l_parameter3 := l_filename;
176 ELSIF (l_parameter4 = ':data') THEN l_parameter4 := l_filename;
177 ELSIF (l_parameter5 = ':data') THEN l_parameter5 := l_filename;
178 ELSIF (l_parameter6 = ':data') THEN l_parameter6 := l_filename;
179 ELSIF (l_parameter7 = ':data') THEN l_parameter7 := l_filename;
180 ELSIF (l_parameter8 = ':data') THEN l_parameter8 := l_filename;
181 ELSIF (l_parameter9 = ':data') THEN l_parameter9 := l_filename;
182 ELSIF (l_parameter10 = ':data') THEN l_parameter10 := l_filename;
183 END IF;
184
185
186 -- find the parameter with the :selective and replace with the
187 -- selective migration details (if any), otherwise replace with
188 -- null
189
190 OPEN csr_migration_info;
191 FETCH csr_migration_info INTO l_migration_type,
192 l_selective_migration_criteria,
193 l_business_group_id,
194 l_security_group;
195 CLOSE csr_migration_info;
196
197 l_selective := null;
198 IF (l_migration_type = 'SD') THEN
199 l_selective := 'DESCRIPTIVE_FLEXFIELD_NAME=' ||
200 l_selective_migration_criteria;
201 END IF;
202 IF (l_migration_type = 'SL') THEN
203 l_selective := 'LOOKUP_TYPE=' ||
204 l_selective_migration_criteria;
205 END IF;
206
207
208 IF (l_parameter1 = ':selective') THEN l_parameter1 := l_selective;
209 ELSIF (l_parameter2 = ':selective') THEN l_parameter2 := l_selective;
210 ELSIF (l_parameter3 = ':selective') THEN l_parameter3 := l_selective;
211 ELSIF (l_parameter4 = ':selective') THEN l_parameter4 := l_selective;
212 ELSIF (l_parameter5 = ':selective') THEN l_parameter5 := l_selective;
213 ELSIF (l_parameter6 = ':selective') THEN l_parameter6 := l_selective;
214 ELSIF (l_parameter7 = ':selective') THEN l_parameter7 := l_selective;
215 ELSIF (l_parameter8 = ':selective') THEN l_parameter8 := l_selective;
216 ELSIF (l_parameter9 = ':selective') THEN l_parameter9 := l_selective;
217 ELSIF (l_parameter10 = ':selective') THEN l_parameter10 := l_selective;
218 END IF;
219
220
221
222 -- find the security group and replace :secgrp with the value
223 -- unless the security group is STANDARD, in this case, replace with null
224
225 IF (l_security_group = 'STANDARD') THEN
226 l_security_group := NULL;
227 ELSE
228 l_security_group := 'SECURITY_GROUP=' || l_security_group;
229 END IF;
230
231 IF (l_parameter1 = ':secgrp') THEN l_parameter1 := l_security_group;
232 ELSIF (l_parameter2 = ':secgrp') THEN l_parameter2 := l_security_group;
233 ELSIF (l_parameter3 = ':secgrp') THEN l_parameter3 := l_security_group;
234 ELSIF (l_parameter4 = ':secgrp') THEN l_parameter4 := l_security_group;
235 ELSIF (l_parameter5 = ':secgrp') THEN l_parameter5 := l_security_group;
236 ELSIF (l_parameter6 = ':secgrp') THEN l_parameter6 := l_security_group;
237 ELSIF (l_parameter7 = ':secgrp') THEN l_parameter7 := l_security_group;
238 ELSIF (l_parameter8 = ':secgrp') THEN l_parameter8 := l_security_group;
239 ELSIF (l_parameter9 = ':secgrp') THEN l_parameter9 := l_security_group;
240 ELSIF (l_parameter10 = ':secgrp') THEN l_parameter10 := l_security_group;
241 END IF;
242
243
244 hr_dm_utility.message('INFO','application ' || l_loader_application, 115);
245 hr_dm_utility.message('INFO','program ' || l_program, 115);
246 hr_dm_utility.message('INFO','sub_request TRUE', 115);
247 hr_dm_utility.message('INFO','argument1 ' || l_parameter1, 115);
248 hr_dm_utility.message('INFO','argument2 ' || l_parameter2, 115);
249 hr_dm_utility.message('INFO','argument3 ' || l_parameter3, 115);
250 hr_dm_utility.message('INFO','argument4 ' || l_parameter4, 115);
251 hr_dm_utility.message('INFO','argument5 ' || l_parameter5, 115);
252 hr_dm_utility.message('INFO','argument6 ' || l_parameter6, 115);
253 hr_dm_utility.message('INFO','argument7 ' || l_parameter7, 115);
254 hr_dm_utility.message('INFO','argument8 ' || l_parameter8, 115);
255 hr_dm_utility.message('INFO','argument9 ' || l_parameter9, 115);
256 hr_dm_utility.message('INFO','argument10 ' || l_parameter10, 115);
257
258
259
260 l_request_id := fnd_request.submit_request(
261 application => l_loader_application,
262 program => l_program,
263 sub_request => TRUE,
264 argument1 => l_parameter1,
265 argument2 => l_parameter2,
266 argument3 => l_parameter3,
267 argument4 => l_parameter4,
268 argument5 => l_parameter5,
269 argument6 => l_parameter6,
270 argument7 => l_parameter7,
271 argument8 => l_parameter8,
272 argument9 => l_parameter9,
273 argument10 => l_parameter10
274 );
275
276
277 COMMIT;
278
279 --
280 -- insert details into view HR_DM_AOL_DOWN_V
281 --
282
283 -- get the destination database name
284 SELECT source_database_instance
285 INTO l_source_database
286 FROM HR_DM_MIGRATIONS
287 WHERE migration_id = p_migration_id;
288
289
290 l_aol_command := l_loader_conc_program || ' apps/apps@' ||
291 l_source_database || ' 0 Y ' ||
292 l_parameter1 || ' ' ||
293 l_parameter2 || ' ' ||
294 l_parameter3 || ' ' ||
295 l_parameter4 || ' ' ||
296 l_parameter5 || ' ' ||
297 l_parameter6 || ' ' ||
298 l_parameter7 || ' ' ||
299 l_parameter8 || ' ' ||
300 l_parameter9 || ' ' ||
301 l_parameter10;
302
303 INSERT INTO HR_DM_AOL_DOWN_V
304 (
305 exp_imp_id
306 ,table_name
307 ,migration_id
308 ,phase_item_id
309 ,code
310 )
311 SELECT
312 hr_dm_exp_imps_s.nextval
313 ,'HR_DM_AOL_DOWN_V'
314 ,p_migration_id
315 ,p_phase_item_id
316 ,l_aol_command
317 FROM dual;
318
319 --
320 --end insert details
321 --
322
323
324 -- update table hr_dm_migration_requests
325 hr_dm_master.insert_request(p_phase => 'DA',
326 p_request_id => l_request_id,
327 p_master_slave => 'S',
328 p_migration_id => p_migration_id,
329 p_phase_id => p_phase_id,
330 p_phase_item_id => p_phase_item_id);
331
332 COMMIT;
333
334 hr_dm_utility.message('INFO','Slave request ID#' || l_request_id, 15);
335 IF (l_request_id = 0) THEN
336 l_fatal_error_message := 'Unable to start slave process';
337 hr_dm_master.report_error('DA', p_migration_id,
338 l_fatal_error_message, 'P');
339 RAISE e_fatal_error;
340 END IF;
341
342
343 hr_dm_utility.message('INFO','Spawned DA slave', 115);
344 hr_dm_utility.message('SUMM','Spawned DA slave', 120);
345 hr_dm_utility.message('ROUT','exit:hr_dm_aol_down.spawn_slaves', 125);
346 hr_dm_utility.message('PARA','(none)', 130);
347
348
349 -- error handling
350 EXCEPTION
351 WHEN e_fatal_error THEN
352 hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.spawn_down',
353 l_fatal_error_message,'R');
354 hr_dm_master.report_error('DA', p_migration_id,
355 'Error in hr_dm_aol_down.spawn_down', 'P');
356 RAISE;
357 WHEN OTHERS THEN
358 hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.spawn_down','(none)','R');
359 hr_dm_master.report_error('DA', p_migration_id,
360 'Untrapped error in hr_dm_aol_down.spawn_down',
361 'P');
362 RAISE;
363
364 --
365 END spawn_down;
366 --
367
368
369
370
371
372 /*--------------------------- PUBLIC ROUTINES ---------------------------*/
373
374 -- ------------------------- main ------------------------
375 -- Description: This is the aol download phase slave. It reads an item from
376 -- the hr_dm_phase_items table for the aol download phase and calls the
377 -- appropriate aol loader.
378 --
379 -- There are two paths through the code, dependent upon if the procedure is
380 -- called at the start of a phase item or after the slave has been awoken
381 -- when the aol loader has finished processing. This is determined by
382 -- examining the concurrent request data which will contain the phase item
383 -- id for a re-awoken slave and null for a first run.
384 --
385 -- On a non-first run (l_request_data <> null), the status of the slave
386 -- is checked to ensure that it has completed. If not then the phase item
387 -- status is set to error and the slave exits. Otherwise the
388 -- phase item is marked as being completed.
389 --
390 --
391 -- The status of the phase is then checked to see if it has errored (by
392 -- another slave). If so, the slave exits.
393 --
394 -- A row is fetched from the phase_items table that has the status of NS.
395 -- If no rows are returned then the slave exits as there are no more rows
396 -- for it to process.
397 --
398 -- If a row is returned then the phase item is marked as being started and
399 -- the spawn_down procedure is used to spawn the aol loader and the slave
400 -- is paused whilst the aol loader is running.
401 --
402 --
403 -- Input Parameters
404 -- p_migration_id - of current migration
405 --
406 -- p_concurrent_process - Y if program called from CM, otherwise
407 -- N prevents message logging
408 --
412 --
409 -- p_last_migration_date - date of last sucessful migration
410 --
411 -- p_process_number - the slave number to allow implicit locking
413 --
414 -- Output Parameters
415 -- errbuf - buffer for output message (for CM manager)
416 --
417 -- retcode - program return code (for CM manager)
418 --
419 --
420 -- ------------------------------------------------------------------------
421
422
423 --
424 PROCEDURE main(errbuf OUT NOCOPY VARCHAR2,
425 retcode OUT NOCOPY NUMBER,
426 p_migration_id IN NUMBER,
427 p_concurrent_process IN VARCHAR2 DEFAULT 'Y',
428 p_last_migration_date IN DATE,
429 p_process_number IN NUMBER
430 ) IS
431 --
432
433 l_current_phase_status VARCHAR2(30);
434 l_phase_id NUMBER;
435 e_fatal_error EXCEPTION;
436 e_fatal_error2 EXCEPTION;
437 l_fatal_error_message VARCHAR2(200);
438 l_loader_name VARCHAR2(30);
439 l_status VARCHAR2(30);
440 l_phase_item_id NUMBER;
441 l_request_data VARCHAR2(100);
442 l_request_id NUMBER;
443 l_call_status BOOLEAN;
444 l_phase VARCHAR2(30);
445 l_dev_phase VARCHAR2(30);
446 l_dev_status VARCHAR2(30);
447 l_message VARCHAR2(240);
448 l_no_of_threads NUMBER;
449 l_business_group_id NUMBER;
450
451 CURSOR csr_get_pi IS
452 SELECT pi.phase_item_id, pi.loader_name, pi.status
453 FROM hr_dm_phase_items pi,
454 hr_dm_tables tbl
455 WHERE (pi.status = 'NS')
456 AND (pi.phase_id = l_phase_id)
457 AND (pi.loader_name = tbl.loader_name)
458 AND ((MOD(pi.phase_item_id, l_no_of_threads) + 1) = p_process_number);
459
460
461 CURSOR csr_req_id IS
462 SELECT request_id
463 FROM hr_dm_migration_requests
464 WHERE phase_item_id = l_phase_item_id
465 AND enabled_flag = 'Y';
466
467 -- get the migration details
468 CURSOR csr_migration_info IS
469 SELECT business_group_id
470 FROM hr_dm_migrations
471 WHERE migration_id = p_migration_id;
472
473 --
474 BEGIN
475 --
476
477 -- initialize messaging (only for concurrent processing)
478 IF (p_concurrent_process = 'Y') THEN
479 hr_dm_utility.message_init;
480 END IF;
481
482 hr_dm_utility.message('ROUT','entry:hr_dm_aol_down.main', 5);
483 hr_dm_utility.message('PARA','(p_migration_id - ' || p_migration_id ||
484 ')(p_last_migration_date - ' ||
485 p_last_migration_date || ')', 10);
486
487 -- get the current phase_id
488 l_phase_id := hr_dm_utility.get_phase_id('DA', p_migration_id);
489
490 -- get the business_group_id
491 OPEN csr_migration_info;
492 FETCH csr_migration_info INTO l_business_group_id;
493 IF csr_migration_info%NOTFOUND THEN
494 CLOSE csr_migration_info;
495 l_fatal_error_message := 'hr_dm_aol_down.main :- Migration Id ' ||
496 TO_CHAR(p_migration_id) || ' not found.';
497 RAISE e_fatal_error2;
498 END IF;
499 CLOSE csr_migration_info;
500
501 -- get the number of threads to enable modulus locking
502 l_no_of_threads := hr_dm_utility.number_of_threads(l_business_group_id);
503
504
505 -- see if this is the first run? (l_request_data = NULL or '?')
506 -- or
507 -- is it a restart after a slave has finished? (l_request_data =
508 -- paused phase item code)
509 l_request_data := fnd_conc_global.request_data;
510 hr_dm_utility.message('INFO','l_request_data ' || l_request_data, 11);
511 IF (l_request_data IS NOT NULL) THEN
512 -- unpaused processing...
513
514 -- check for error in slave
515 l_phase_item_id := TO_NUMBER(l_request_data);
516
517 -- find request_id
518 OPEN csr_req_id;
519 FETCH csr_req_id INTO l_request_id;
520 CLOSE csr_req_id;
521
522 l_call_status := fnd_concurrent.get_request_status(l_request_id, '', '',
523 l_phase, l_status, l_dev_phase,
524 l_dev_status, l_message);
525 -- make sure that each slave is complete and normal, if not then log
526 IF ( NOT( (l_dev_phase = 'COMPLETE') AND (l_dev_status = 'NORMAL') )) THEN
527
528 -- update status to error
529 hr_dm_utility.update_phase_items(p_new_status => 'E',
530 p_id => l_phase_item_id);
531 l_fatal_error_message := 'Sub-slave process in error - slave exiting';
532 RAISE e_fatal_error;
533 ELSE
534 -- update status to completed
535 hr_dm_utility.update_phase_items(p_new_status => 'C',
536 p_id => l_phase_item_id);
537 END IF;
538
539 -- reset request data flag
540 l_request_data := '?';
541 END IF;
542
543
544 -- get status of DA phase, is phase completed?
545 -- if null returned, then assume it is NS.
546 l_current_phase_status := NVL(hr_dm_utility.get_phase_status('DA',
547 p_migration_id), 'NS');
548
549 -- if status is error, then raise an exception
550 IF (l_current_phase_status = 'E') THEN
551 l_fatal_error_message := 'Current phase in error - slave exiting';
552 RAISE e_fatal_error2;
553 END IF;
554
555
556 -- now process remaining rows...
557
558
559 -- fetch a row from the phase items table
563 IF (csr_get_pi%FOUND) THEN
560 OPEN csr_get_pi;
561 FETCH csr_get_pi INTO l_phase_item_id, l_loader_name,
562 l_status;
564
565 -- update status to started
566 hr_dm_utility.update_phase_items(p_new_status => 'S',
567 p_id => l_phase_item_id);
568
569 -- send info on current table to logfile
570 hr_dm_utility.message('INFO','Processing - ' || l_loader_name, 13);
571
572
573 -- call code for AOL loader
574 spawn_down(p_migration_id => p_migration_id,
575 p_phase_id => l_phase_id,
576 p_phase_item_id => l_phase_item_id);
577
578
579 -- pause master whilst slaves process data...
580 -- set request data to indicate paused phase
581 fnd_conc_global.set_req_globals(conc_status => 'PAUSED',
582 request_data => l_phase_item_id);
583
584 errbuf := 'No errors - examine logfiles for detailed reports.';
585 END IF;
586
587 IF (csr_get_pi%NOTFOUND) THEN
588 errbuf := 'No errors - examine logfiles for detailed reports.';
589 END IF;
590
591 CLOSE csr_get_pi;
592
593
594 -- set up return values to concurrent manager
595 retcode := 0;
596 IF (NVL(l_request_data, '?') <> '?') THEN
597 errbuf := 'No errors - examine logfiles for detailed reports.';
598 ELSE
599 errbuf := 'Slave Controller is paused.';
600 END IF;
601
602
603 hr_dm_utility.message('INFO','DA - main controller', 15);
604 hr_dm_utility.message('SUMM','DA - main controller', 20);
605 hr_dm_utility.message('ROUT','exit:hr_dm_aol_down.main', 25);
606 hr_dm_utility.message('PARA','(retcode - ' || retcode ||
607 ')(errbuf - ' || errbuf || ')', 30);
608
609 -- error handling
610 EXCEPTION
611 WHEN e_fatal_error THEN
612 retcode := 2;
613 errbuf := 'An error occurred during the migration - ' ||
614 'examine logfiles for detailed reports.';
615 hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main',
616 l_fatal_error_message,'DA');
617 hr_dm_utility.update_phase_items(p_new_status => 'E',
618 p_id => l_phase_item_id);
619 hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main','(none)','R');
620 WHEN e_fatal_error2 THEN
621 retcode := 0;
622 errbuf := 'An error occurred during the migration - ' ||
623 'examine logfiles for detailed reports.';
624 hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main',
625 l_fatal_error_message,'DA');
626 hr_dm_utility.update_phases(p_new_status => 'E',
627 p_id => l_phase_id);
628 hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main','(none)','R');
629 WHEN OTHERS THEN
630 retcode := 2;
631 errbuf := 'An error occurred during the migration - ' ||
632 'examine logfiles for detailed reports.';
633 -- update status to error
634 hr_dm_utility.update_phase_items(p_new_status => 'E',
635 p_id => l_phase_item_id);
636 hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main','(none)','R');
637
638
639 --
640 END main;
641 --
642
643
644 END hr_dm_aol_down;