DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PER_DEL

Source


1 Package Body per_per_del as
2 /* $Header: peperrhi.pkb 120.20.12020000.5 2013/05/16 10:39:02 srannama ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_per_del.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_delete_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the actual dml delete logic for the datetrack
17 --   delete modes: ZAP, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE. The
18 --   execution is as follows:
19 --   1) To set and unset the g_api_dml status as required (as we are about to
20 --      perform dml).
21 --   2) If the delete mode is DELETE_NEXT_CHANGE then delete where the
22 --      effective start date is equal to the validation start date.
23 --   3) If the delete mode is not DELETE_NEXT_CHANGE then delete
24 --      all rows for the entity where the effective start date is greater
25 --      than or equal to the validation start date.
26 --   4) To raise any errors.
27 --
28 -- Pre Conditions:
29 --   This is an internal private procedure which must be called from the
30 --   delete_dml procedure.
31 --
32 -- In Arguments:
33 --   A Pl/Sql record structre.
34 --
35 -- Post Success:
36 --   The specified row will be delete from the schema.
37 --
38 -- Post Failure:
39 --   On the delete dml failure it is important to note that we always reset the
40 --   g_api_dml status to false.
41 --   If any other error is reported, the error will be raised after the
42 --   g_api_dml status is reset.
43 --
44 -- Developer Implementation Notes:
45 --   This is an internal private procedure which must be called from the
46 --   delete_dml procedure.
47 --
48 -- Access Status:
49 --   Internal Table Handler Use Only.
50 --
51 -- {End Of Comments}
52 -- ----------------------------------------------------------------------------
53 Procedure dt_delete_dml
54    (p_rec          in out nocopy per_per_shd.g_rec_type,
55     p_effective_date  in   date,
56     p_datetrack_mode  in   varchar2,
57     p_validation_start_date in   date,
58     p_validation_end_date   in   date) is
59 --
60   l_proc varchar2(72) := g_package||'dt_delete_dml';
61 --
62 Begin
63   hr_utility.set_location('Entering:'||l_proc, 5);
64   If (p_datetrack_mode = 'DELETE_NEXT_CHANGE') then
65     hr_utility.set_location(l_proc, 10);
66     per_per_shd.g_api_dml := true;  -- Set the api dml status
67     --
68     -- Delete the where the effective start date is equal
69     -- to the validation end date.
70     --
71     delete from per_all_people_f
72     where       person_id = p_rec.person_id
73     and    effective_start_date = p_validation_start_date;
74     --
75     per_per_shd.g_api_dml := false;   -- Unset the api dml status
76   Else
77     hr_utility.set_location(l_proc, 15);
78     per_per_shd.g_api_dml := true;  -- Set the api dml status
79     --
80     -- Delete the row(s) where the effective start date is greater than
81     -- or equal to the validation start date.
82     --
83     delete from per_all_people_f
84     where        person_id = p_rec.person_id
85     and    effective_start_date >= p_validation_start_date;
86     --
87     per_per_shd.g_api_dml := false;   -- Unset the api dml status
88   End If;
89   --
90   hr_utility.set_location(' Leaving:'||l_proc, 20);
91 --
92 Exception
93   When Others Then
94     per_per_shd.g_api_dml := false;   -- Unset the api dml status
95     Raise;
96 End dt_delete_dml;
97 --
98 -- ----------------------------------------------------------------------------
99 -- |------------------------------< delete_dml >------------------------------|
100 -- ----------------------------------------------------------------------------
101 Procedure delete_dml
102    (p_rec          in out nocopy per_per_shd.g_rec_type,
103     p_effective_date  in   date,
104     p_datetrack_mode  in   varchar2,
105     p_validation_start_date in   date,
106     p_validation_end_date   in   date) is
107 --
108   l_proc varchar2(72) := g_package||'delete_dml';
109 --
110 Begin
111   hr_utility.set_location('Entering:'||l_proc, 5);
112   --
113   dt_delete_dml(p_rec         => p_rec,
114       p_effective_date  => p_effective_date,
115       p_datetrack_mode  => p_datetrack_mode,
116             p_validation_start_date => p_validation_start_date,
117       p_validation_end_date   => p_validation_end_date);
118   --
119   hr_utility.set_location(' Leaving:'||l_proc, 10);
120 End delete_dml;
121 --
122 -- ----------------------------------------------------------------------------
123 -- |----------------------------< dt_pre_delete >-----------------------------|
124 -- ----------------------------------------------------------------------------
125 -- {Start Of Comments}
126 --
127 -- Description:
128 --   The dt_pre_delete process controls the execution of dml
129 --   for the datetrack modes: DELETE, FUTURE_CHANGE
130 --   and DELETE_NEXT_CHANGE only.
131 --
132 -- Pre Conditions:
133 --   This is an internal procedure which is called from the pre_delete
134 --   procedure.
135 --
136 -- In Arguments:
137 --   A Pl/Sql record structre.
138 --
139 -- Post Success:
140 --   Processing continues.
141 --
142 -- Post Failure:
143 --   If an error has occurred, an error message and exception will be raised
144 --   but not handled.
145 --
146 -- Developer Implementation Notes:
147 --   This is an internal procedure which is required by Datetrack. Don't
148 --   remove or modify.
149 --
150 -- Access Status:
151 --   Internal Table Handler Use Only.
152 --
153 -- {End Of Comments}
154 -- ----------------------------------------------------------------------------
155 Procedure dt_pre_delete
156    (p_rec          in out nocopy per_per_shd.g_rec_type,
157     p_effective_date  in   date,
158     p_datetrack_mode  in   varchar2,
159     p_validation_start_date in   date,
160     p_validation_end_date   in   date) is
161 --
162   l_proc varchar2(72) := g_package||'dt_pre_delete';
163 --
164 Begin
165   hr_utility.set_location('Entering:'||l_proc, 5);
166   --
167    If (p_datetrack_mode <> 'ZAP') then
168      --
169      p_rec.effective_start_date :=
170         per_per_shd.g_old_rec.effective_start_date;
171      --
172      If (p_datetrack_mode = 'DELETE') then
173        p_rec.effective_end_date := p_validation_start_date - 1;
174      Else
175        p_rec.effective_end_date := p_validation_end_date;
176    End If;
177      --
178      -- Update the current effective end date record
179      --
180      per_per_shd.upd_effective_end_date
181       (p_effective_date         => p_effective_date,
182        p_base_key_value         => p_rec.person_id,
183        p_new_effective_end_date => p_rec.effective_end_date,
184        p_validation_start_date  => p_validation_start_date,
185        p_validation_end_date  => p_validation_end_date,
186        p_object_version_number  => p_rec.object_version_number);
187    Else
188      p_rec.effective_start_date := null;
189      p_rec.effective_end_date := null;
190    End If;
191   hr_utility.set_location(' Leaving:'||l_proc, 10);
192 End dt_pre_delete;
193 --
194 -- ----------------------------------------------------------------------------
195 -- |------------------------------< pre_delete >------------------------------|
196 -- ----------------------------------------------------------------------------
197 -- {Start Of Comments}
198 --
199 -- Description:
200 --   This private procedure contains any processing which is required before
201 --   the delete dml.
202 --
203 -- Pre Conditions:
204 --   This is an internal procedure which is called from the del procedure.
205 --
206 -- In Arguments:
207 --   A Pl/Sql record structre.
208 --
209 -- Post Success:
210 --   Processing continues.
211 --
212 -- Post Failure:
213 --   If an error has occurred, an error message and exception will be raised
214 --   but not handled.
215 --
216 -- Developer Implementation Notes:
217 --   Any pre-processing required before the delete dml is issued should be
218 --   coded within this procedure. It is important to note that any 3rd party
219 --   maintenance should be reviewed before placing in this procedure. The call
220 --   to the dt_delete_dml procedure should NOT be removed.
221 --
222 -- Access Status:
223 --   Internal Table Handler Use Only.
224 --
225 -- {End Of Comments}
226 -- ----------------------------------------------------------------------------
227 Procedure pre_delete
228    (p_rec          in out nocopy per_per_shd.g_rec_type,
229     p_effective_date  in   date,
230     p_datetrack_mode  in   varchar2,
231     p_validation_start_date in   date,
232     p_validation_end_date   in   date) is
233 --
234   l_proc varchar2(72) := g_package||'pre_delete';
235 --
236   l_per_rec per_all_people_f%rowtype;
237   cursor l_per_cur is
238     select *
239     from  per_all_people_f
240     where person_id            = p_rec.person_id
241     and   effective_start_date = p_rec.effective_start_date
242     and   effective_end_date   = p_rec.effective_end_date;
243 
244 /* Cursor l_per_cur1 created as part of fix for bug 4610184.
245    Created a new cursor considering the performance issue if we use
246    nvl statement in Cussor l_per_cur. */
247 
248   cursor l_per_cur1 is
249     select *
250     from  per_all_people_f
251     where person_id            = p_rec.person_id;
252   --
253   -- Cursor C_Sel1 select comments to be deleted
254   --
255   Cursor C_Sel1 is
256     select t1.comment_id
257     from   per_all_people_f t1
258     where  t1.comment_id is not null
259     and    t1.person_id = p_rec.person_id
260     and    t1.effective_start_date <= p_validation_end_date
261     and    t1.effective_end_date   >= p_validation_start_date
262     and    not exists
263            (select 1
264             from   per_all_people_f t2
265             where  t2.comment_id = t1.comment_id
266             and    t2.person_id = t1.person_id
267             and   (t2.effective_start_date > p_validation_end_date
268              or    t2.effective_end_date   < p_validation_start_date));
269   --
270 --
271 Begin
272   hr_utility.set_location('Entering:'||l_proc, 5);
273   --
274   --
275   -- Delete any possible comments
276   --
277   For Comm_Del In C_Sel1 Loop
278     hr_comm_api.del(p_comment_id        => Comm_Del.comment_id);
279   End Loop;
280   --
281   dt_pre_delete
282     (p_rec          => p_rec,
283      p_effective_date        => p_effective_date,
284      p_datetrack_mode        => p_datetrack_mode,
285      p_validation_start_date => p_validation_start_date,
286      p_validation_end_date   => p_validation_end_date);
287   --
288   -- Start of HR/WF Synchronization
289 
290   --fix for bug 4610184 starts here.
291 
292    if (p_rec.effective_start_date is null or p_rec.effective_end_date is null) then
293 
294     open l_per_cur1;
295     fetch l_per_cur1 into l_per_rec;
296     close l_per_cur1;
297 
298    else
299 
300     open l_per_cur;
301     fetch l_per_cur into l_per_rec;
302     close l_per_cur;
303 
304    end if;
305 
306   --fix for bug 4610184 ends here.
307     --
308     per_hrwf_synch.per_per_wf(
309                    p_rec       => l_per_rec,
310                    p_action    => 'DELETE');
311   -- End of HR/WF Synchronization
312   --
313   hr_utility.set_location(' Leaving:'||l_proc, 10);
314 End pre_delete;
315 --
316 -- ----------------------------------------------------------------------------
317 -- |-----------------------------< post_delete >------------------------------|
318 -- ----------------------------------------------------------------------------
319 -- {Start Of Comments}
320 --
321 -- Description:
322 --   This private procedure contains any processing which is required after the
323 --   delete dml.
324 --
325 -- Pre Conditions:
326 --   This is an internal procedure which is called from the del procedure.
327 --
328 -- In Arguments:
329 --   A Pl/Sql record structre.
330 --
331 -- Post Success:
332 --   Processing continues.
333 --
334 -- Post Failure:
335 --   If an error has occurred, an error message and exception will be raised
336 --   but not handled.
337 --
338 -- Developer Implementation Notes:
339 --   Any post-processing required after the delete dml is issued should be
340 --   coded within this procedure. It is important to note that any 3rd party
341 --   maintenance should be reviewed before placing in this procedure.
342 --
343 -- Access Status:
344 --   Internal Table Handler Use Only.
345 --
346 -- {End Of Comments}
347 -- ----------------------------------------------------------------------------
348 Procedure post_delete
349    (p_rec          in per_per_shd.g_rec_type,
350     p_effective_date  in date,
351     p_datetrack_mode  in varchar2,
352     p_validation_start_date in date,
353     p_validation_end_date   in date) is
354 --
355   l_proc varchar2(72) := g_package||'post_delete';
356 --
357 Begin
358   hr_utility.set_location('Entering:'||l_proc, 5);
359   --
360   -- Start of API User Hook for post_delete.
361   begin
362     per_per_rkd.after_delete
363       (p_effective_date            => p_effective_date
364       ,p_validation_start_date     => p_validation_start_date
365       ,p_validation_end_date       => p_validation_end_date
366       ,p_datetrack_mode            => p_datetrack_mode
367       ,p_person_id                 => p_rec.person_id
368       ,p_effective_start_date      => p_rec.effective_start_date
369       ,p_effective_end_date        => p_rec.effective_end_date
370       ,p_object_version_number     => p_rec.object_version_number
371       ,p_effective_start_date_o
372           => per_per_shd.g_old_rec.effective_start_date
373       ,p_effective_end_date_o
374           => per_per_shd.g_old_rec.effective_end_date
375       ,p_business_group_id_o
376           => per_per_shd.g_old_rec.business_group_id
377       ,p_person_type_id_o
378           => per_per_shd.g_old_rec.person_type_id
379       ,p_last_name_o
380           => per_per_shd.g_old_rec.last_name
381       ,p_start_date_o
382           => per_per_shd.g_old_rec.start_date
383       ,p_applicant_number_o
384           => per_per_shd.g_old_rec.applicant_number
385       ,p_comment_id_o
386           => per_per_shd.g_old_rec.comment_id
387       ,p_current_applicant_flag_o
388           => per_per_shd.g_old_rec.current_applicant_flag
389       ,p_current_emp_or_apl_flag_o
390           => per_per_shd.g_old_rec.current_emp_or_apl_flag
391       ,p_current_employee_flag_o
392           => per_per_shd.g_old_rec.current_employee_flag
393       ,p_date_employee_data_verifie_o
394           => per_per_shd.g_old_rec.date_employee_data_verified
395       ,p_date_of_birth_o
396           => per_per_shd.g_old_rec.date_of_birth
397       ,p_email_address_o
398           => per_per_shd.g_old_rec.email_address
399       ,p_employee_number_o
400           => per_per_shd.g_old_rec.employee_number
401       ,p_expense_check_send_to_addr_o
402           => per_per_shd.g_old_rec.expense_check_send_to_address
403       ,p_first_name_o
404           => per_per_shd.g_old_rec.first_name
405       ,p_full_name_o
406           => per_per_shd.g_old_rec.full_name
407       ,p_known_as_o
408           => per_per_shd.g_old_rec.known_as
409       ,p_marital_status_o
410           => per_per_shd.g_old_rec.marital_status
411       ,p_middle_names_o
412           => per_per_shd.g_old_rec.middle_names
413       ,p_nationality_o
414           => per_per_shd.g_old_rec.nationality
415       ,p_national_identifier_o
416           => per_per_shd.g_old_rec.national_identifier
417       ,p_previous_last_name_o
418           => per_per_shd.g_old_rec.previous_last_name
419       ,p_registered_disabled_flag_o
420           => per_per_shd.g_old_rec.registered_disabled_flag
421       ,p_sex_o
422           => per_per_shd.g_old_rec.sex
423       ,p_title_o
424           => per_per_shd.g_old_rec.title
425       ,p_vendor_id_o
426           => per_per_shd.g_old_rec.vendor_id
427       ,p_work_telephone_o
428           => per_per_shd.g_old_rec.work_telephone
429       ,p_request_id_o
430           => per_per_shd.g_old_rec.request_id
431       ,p_program_application_id_o
432           => per_per_shd.g_old_rec.program_application_id
433       ,p_program_id_o
434           => per_per_shd.g_old_rec.program_id
435       ,p_program_update_date_o
436           => per_per_shd.g_old_rec.program_update_date
437       ,p_attribute_category_o
438           => per_per_shd.g_old_rec.attribute_category
439       ,p_attribute1_o
440           => per_per_shd.g_old_rec.attribute1
441       ,p_attribute2_o
442           => per_per_shd.g_old_rec.attribute2
443       ,p_attribute3_o
444           => per_per_shd.g_old_rec.attribute3
445       ,p_attribute4_o
446           => per_per_shd.g_old_rec.attribute4
447       ,p_attribute5_o
448           => per_per_shd.g_old_rec.attribute5
449       ,p_attribute6_o
450           => per_per_shd.g_old_rec.attribute6
451       ,p_attribute7_o
452           => per_per_shd.g_old_rec.attribute7
453       ,p_attribute8_o
454           => per_per_shd.g_old_rec.attribute8
455       ,p_attribute9_o
456           => per_per_shd.g_old_rec.attribute9
457       ,p_attribute10_o
458           => per_per_shd.g_old_rec.attribute10
459       ,p_attribute11_o
460           => per_per_shd.g_old_rec.attribute11
461       ,p_attribute12_o
462           => per_per_shd.g_old_rec.attribute12
463       ,p_attribute13_o
464           => per_per_shd.g_old_rec.attribute13
465       ,p_attribute14_o
466           => per_per_shd.g_old_rec.attribute14
467       ,p_attribute15_o
468           => per_per_shd.g_old_rec.attribute15
469       ,p_attribute16_o
470           => per_per_shd.g_old_rec.attribute16
471       ,p_attribute17_o
472           => per_per_shd.g_old_rec.attribute17
473       ,p_attribute18_o
474           => per_per_shd.g_old_rec.attribute18
475       ,p_attribute19_o
476           => per_per_shd.g_old_rec.attribute19
477       ,p_attribute20_o
478           => per_per_shd.g_old_rec.attribute20
479       ,p_attribute21_o
480           => per_per_shd.g_old_rec.attribute21
481       ,p_attribute22_o
482           => per_per_shd.g_old_rec.attribute22
483       ,p_attribute23_o
484           => per_per_shd.g_old_rec.attribute23
485       ,p_attribute24_o
486           => per_per_shd.g_old_rec.attribute24
487       ,p_attribute25_o
488           => per_per_shd.g_old_rec.attribute25
489       ,p_attribute26_o
490           => per_per_shd.g_old_rec.attribute26
491       ,p_attribute27_o
492           => per_per_shd.g_old_rec.attribute27
493       ,p_attribute28_o
494           => per_per_shd.g_old_rec.attribute28
495       ,p_attribute29_o
496           => per_per_shd.g_old_rec.attribute29
497       ,p_attribute30_o
498           => per_per_shd.g_old_rec.attribute30
499       ,p_per_information_category_o
500           => per_per_shd.g_old_rec.per_information_category
501       ,p_per_information1_o
502           => per_per_shd.g_old_rec.per_information1
503       ,p_per_information2_o
504           => per_per_shd.g_old_rec.per_information2
505       ,p_per_information3_o
506           => per_per_shd.g_old_rec.per_information3
507       ,p_per_information4_o
508           => per_per_shd.g_old_rec.per_information4
509       ,p_per_information5_o
510           => per_per_shd.g_old_rec.per_information5
511       ,p_per_information6_o
512           => per_per_shd.g_old_rec.per_information6
513       ,p_per_information7_o
514           => per_per_shd.g_old_rec.per_information7
515       ,p_per_information8_o
516           => per_per_shd.g_old_rec.per_information8
517       ,p_per_information9_o
518           => per_per_shd.g_old_rec.per_information9
519       ,p_per_information10_o
520           => per_per_shd.g_old_rec.per_information10
521       ,p_per_information11_o
522           => per_per_shd.g_old_rec.per_information11
523       ,p_per_information12_o
524           => per_per_shd.g_old_rec.per_information12
525       ,p_per_information13_o
526           => per_per_shd.g_old_rec.per_information13
527       ,p_per_information14_o
528           => per_per_shd.g_old_rec.per_information14
529       ,p_per_information15_o
530           => per_per_shd.g_old_rec.per_information15
531       ,p_per_information16_o
532           => per_per_shd.g_old_rec.per_information16
533       ,p_per_information17_o
534           => per_per_shd.g_old_rec.per_information17
535       ,p_per_information18_o
536           => per_per_shd.g_old_rec.per_information18
537       ,p_per_information19_o
538           => per_per_shd.g_old_rec.per_information19
539       ,p_per_information20_o
540           => per_per_shd.g_old_rec.per_information20
541       ,p_suffix_o
542           => per_per_shd.g_old_rec.suffix
543       ,p_DATE_OF_DEATH_o
544           => per_per_shd.g_old_rec.DATE_OF_DEATH
545       ,p_BACKGROUND_CHECK_STATUS_o
546           => per_per_shd.g_old_rec.BACKGROUND_CHECK_STATUS
547       ,p_BACKGROUND_DATE_CHECK_o
548           => per_per_shd.g_old_rec.BACKGROUND_DATE_CHECK
549       ,p_BLOOD_TYPE_o
550           => per_per_shd.g_old_rec.BLOOD_TYPE
551       ,p_CORRESPONDENCE_LANGUAGE_o
552           => per_per_shd.g_old_rec.CORRESPONDENCE_LANGUAGE
553       ,p_FAST_PATH_EMPLOYEE_o
554           => per_per_shd.g_old_rec.FAST_PATH_EMPLOYEE
555       ,p_FTE_CAPACITY_o
556           => per_per_shd.g_old_rec.FTE_CAPACITY
557       ,p_HOLD_APPLICANT_DATE_UNTIL_o
558           => per_per_shd.g_old_rec.HOLD_APPLICANT_DATE_UNTIL
559       ,p_HONORS_o
560           => per_per_shd.g_old_rec.HONORS
561       ,p_INTERNAL_LOCATION_o
562           => per_per_shd.g_old_rec.INTERNAL_LOCATION
563       ,p_LAST_MEDICAL_TEST_BY_o
564           => per_per_shd.g_old_rec.LAST_MEDICAL_TEST_BY
565       ,p_LAST_MEDICAL_TEST_DATE_o
566           => per_per_shd.g_old_rec.LAST_MEDICAL_TEST_DATE
567       ,p_MAILSTOP_o
568           => per_per_shd.g_old_rec.MAILSTOP
569       ,p_OFFICE_NUMBER_o
570           => per_per_shd.g_old_rec.OFFICE_NUMBER
571       ,p_ON_MILITARY_SERVICE_o
572           => per_per_shd.g_old_rec.ON_MILITARY_SERVICE
573       ,p_ORDER_NAME_o
574           => per_per_shd.g_old_rec.ORDER_NAME
575       ,p_PRE_NAME_ADJUNCT_o
576           => per_per_shd.g_old_rec.PRE_NAME_ADJUNCT
577       ,p_PROJECTED_START_DATE_o
578           => per_per_shd.g_old_rec.PROJECTED_START_DATE
579       ,p_REHIRE_AUTHORIZOR_o
580           => per_per_shd.g_old_rec.REHIRE_AUTHORIZOR
581       ,p_REHIRE_RECOMMENDATION_o
582           => per_per_shd.g_old_rec.REHIRE_RECOMMENDATION
583       ,p_RESUME_EXISTS_o
584           => per_per_shd.g_old_rec.RESUME_EXISTS
585       ,p_RESUME_LAST_UPDATED_o
586           => per_per_shd.g_old_rec.RESUME_LAST_UPDATED
587       ,p_SECOND_PASSPORT_EXISTS_o
588           => per_per_shd.g_old_rec.SECOND_PASSPORT_EXISTS
589       ,p_STUDENT_STATUS_o
590           => per_per_shd.g_old_rec.STUDENT_STATUS
591       ,p_WORK_SCHEDULE_o
592           => per_per_shd.g_old_rec.WORK_SCHEDULE
593       ,p_PER_INFORMATION21_o
594           => per_per_shd.g_old_rec.PER_INFORMATION21
595       ,p_PER_INFORMATION22_o
596           => per_per_shd.g_old_rec.PER_INFORMATION22
597       ,p_PER_INFORMATION23_o
598           => per_per_shd.g_old_rec.PER_INFORMATION23
599       ,p_PER_INFORMATION24_o
600           => per_per_shd.g_old_rec.PER_INFORMATION24
601       ,p_PER_INFORMATION25_o
602           => per_per_shd.g_old_rec.PER_INFORMATION25
603       ,p_PER_INFORMATION26_o
604           => per_per_shd.g_old_rec.PER_INFORMATION26
605       ,p_PER_INFORMATION27_o
606           => per_per_shd.g_old_rec.PER_INFORMATION27
607       ,p_PER_INFORMATION28_o
608           => per_per_shd.g_old_rec.PER_INFORMATION28
609       ,p_PER_INFORMATION29_o
610           => per_per_shd.g_old_rec.PER_INFORMATION29
611       ,p_PER_INFORMATION30_o
612           => per_per_shd.g_old_rec.PER_INFORMATION30
613       ,p_REHIRE_REASON_o
614           => per_per_shd.g_old_rec.REHIRE_REASON
615       ,p_BENEFIT_GROUP_ID_o
616          => per_per_shd.g_old_rec.BENEFIT_GROUP_ID
617       ,p_RECEIPT_OF_DEATH_CERT_DATE_o
618          => per_per_shd.g_old_rec.RECEIPT_OF_DEATH_CERT_DATE
619       ,p_COORD_BEN_MED_PLN_NO_o
620          => per_per_shd.g_old_rec.COORD_BEN_MED_PLN_NO
621       ,p_COORD_BEN_NO_CVG_FLAG_o
622          => per_per_shd.g_old_rec.COORD_BEN_NO_CVG_FLAG
623       ,p_coord_ben_med_ext_er_o
624          => per_per_shd.g_old_rec.coord_ben_med_ext_er
625       ,p_coord_ben_med_pl_name_o
626          => per_per_shd.g_old_rec.coord_ben_med_pl_name
627       ,p_coord_ben_med_insr_crr_nam_o
628          => per_per_shd.g_old_rec.coord_ben_med_insr_crr_name
629       ,p_coord_ben_med_insr_crr_ide_o
630          => per_per_shd.g_old_rec.coord_ben_med_insr_crr_ident
631       ,p_coord_ben_med_cvg_strt_dt_o
632          => per_per_shd.g_old_rec.coord_ben_med_cvg_strt_dt
633       ,p_coord_ben_med_cvg_end_dt_o
634          => per_per_shd.g_old_rec.coord_ben_med_cvg_end_dt
635       ,p_USES_TOBACCO_FLAG_o
636          => per_per_shd.g_old_rec.USES_TOBACCO_FLAG
637       ,p_DPDNT_ADOPTION_DATE_o
638          => per_per_shd.g_old_rec.DPDNT_ADOPTION_DATE
639       ,p_DPDNT_VLNTRY_SVCE_FLAG_o
640          => per_per_shd.g_old_rec.DPDNT_VLNTRY_SVCE_FLAG
641       ,p_ORIGINAL_DATE_OF_HIRE_o
642          => per_per_shd.g_old_rec.ORIGINAL_DATE_OF_HIRE
643     ,p_town_of_birth_o
644        => per_per_shd.g_old_rec.town_of_birth
645     ,p_region_of_birth_o
646        => per_per_shd.g_old_rec.region_of_birth
647     ,p_country_of_birth_o
648        => per_per_shd.g_old_rec.country_of_birth
649     ,p_global_person_id_o
650        => per_per_shd.g_old_rec.global_person_id
651     ,p_party_id_o
652        => per_per_shd.g_old_rec.party_id
653       ,p_npw_number_o
654           => per_per_shd.g_old_rec.npw_number
655       ,p_current_npw_flag_o
656           => per_per_shd.g_old_rec.current_npw_flag
657       ,p_global_name_o
658          => per_per_shd.g_old_rec.global_name
659       ,p_local_name_o
660          => per_per_shd.g_old_rec.local_name
661       ,p_object_version_number_o
662           => per_per_shd.g_old_rec.object_version_number
663       );
664   exception
665     when hr_api.cannot_find_prog_unit then
666       hr_api.cannot_find_prog_unit_error
667         (p_module_name => 'per_all_people_f'
668         ,p_hook_type   => 'AD'
669         );
670   end;
671   -- End of API User Hook for post_delete.
672   --
673   hr_utility.set_location(' Leaving:'||l_proc, 10);
674 End post_delete;
675 --
676 -- ----------------------------------------------------------------------------
677 -- |---------------------------------< del >----------------------------------|
678 -- ----------------------------------------------------------------------------
679 Procedure del
680   (
681   p_rec        in out nocopy  per_per_shd.g_rec_type,
682   p_effective_date   in    date,
683   p_datetrack_mode   in    varchar2,
684   p_validate         in    boolean default false
685   ) is
686 --
687   l_proc       varchar2(72) := g_package||'del';
688   l_validation_start_date  date;
689   l_validation_end_date    date;
690 --
691 Begin
692   hr_utility.set_location('Entering:'||l_proc, 5);
693   --
694   -- Ensure that the DateTrack delete mode is valid
695   --
696   dt_api.validate_dt_del_mode(p_datetrack_mode => p_datetrack_mode);
697   --
698   -- Determine if the business process is to be validated.
699   --
700   If p_validate then
701     --
702     -- Issue the savepoint.
703     --
704     SAVEPOINT del_per_per;
705   End If;
706   --
707   -- We must lock the row which we need to delete.
708   --
709   per_per_shd.lck
710    (p_effective_date  => p_effective_date,
711           p_datetrack_mode  => p_datetrack_mode,
712           p_person_id    => p_rec.person_id,
713           p_object_version_number => p_rec.object_version_number,
714           p_validation_start_date => l_validation_start_date,
715           p_validation_end_date   => l_validation_end_date);
716   --
717   -- Call the supporting delete validate operation
718   --
719   per_per_bus.delete_validate
720    (p_rec          => p_rec,
721     p_effective_date  => p_effective_date,
722     p_datetrack_mode  => p_datetrack_mode,
723     p_validation_start_date => l_validation_start_date,
724     p_validation_end_date   => l_validation_end_date);
725   --
726   hr_multi_message.end_validation_set;
727   -- Call the supporting pre-delete operation
728   --
729   pre_delete
730    (p_rec          => p_rec,
731     p_effective_date  => p_effective_date,
732     p_datetrack_mode  => p_datetrack_mode,
733     p_validation_start_date => l_validation_start_date,
734     p_validation_end_date   => l_validation_end_date);
735   --
736   -- Delete the row.
737   --
738   delete_dml
739    (p_rec          => p_rec,
740     p_effective_date  => p_effective_date,
741     p_datetrack_mode  => p_datetrack_mode,
742     p_validation_start_date => l_validation_start_date,
743     p_validation_end_date   => l_validation_end_date);
744   --
745   -- Call the supporting post-delete operation
746   --
747   post_delete
748    (p_rec          => p_rec,
749     p_effective_date  => p_effective_date,
750     p_datetrack_mode  => p_datetrack_mode,
751     p_validation_start_date => l_validation_start_date,
752     p_validation_end_date   => l_validation_end_date);
753   --
754   hr_multi_message.end_validation_set;
755   -- If we are validating then raise the Validate_Enabled exception
756   --
757   If p_validate then
758     Raise HR_Api.Validate_Enabled;
759   End If;
760   --
761   hr_utility.set_location(' Leaving:'||l_proc, 10);
762 Exception
763   When HR_Api.Validate_Enabled Then
764     --
765     -- As the Validate_Enabled exception has been raised
766     -- we must rollback to the savepoint
767     --
768     ROLLBACK TO del_per_per;
769 End del;
770 --
771 -- ----------------------------------------------------------------------------
772 -- |---------------------------------< del >----------------------------------|
773 -- ----------------------------------------------------------------------------
774 Procedure del
775   (p_person_id   in   number,
776   p_effective_start_date     out nocopy date,
777   p_effective_end_date       out nocopy date,
778   p_object_version_number in out nocopy number,
779   p_effective_date     in     date,
780   p_datetrack_mode     in     varchar2,
781   p_validate        in     boolean default false
782   ) is
783 --
784   l_rec     per_per_shd.g_rec_type;
785   l_proc varchar2(72) := g_package||'del';
786 --
787 Begin
788   hr_utility.set_location('Entering:'||l_proc, 5);
789   --
790   -- As the delete procedure accepts a plsql record structure we do need to
791   -- convert the  arguments into the record structure.
792   -- We don't need to call the supplied conversion argument routine as we
793   -- only need a few attributes.
794   --
795   l_rec.person_id    := p_person_id;
796   l_rec.object_version_number    := p_object_version_number;
797   --
798   -- Having converted the arguments into the per_per_rec
799   -- plsql record structure we must call the corresponding entity
800   -- business process
801   --
802   del(l_rec, p_effective_date, p_datetrack_mode, p_validate);
803   --
804   -- Set the out arguments
805   --
806   p_object_version_number := l_rec.object_version_number;
807   p_effective_start_date  := l_rec.effective_start_date;
808   p_effective_end_date    := l_rec.effective_end_date;
809   --
810   hr_utility.set_location(' Leaving:'||l_proc, 10);
811 End del;
812 --
813 end per_per_del;