DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_DEI_DEL

Source


1 Package Body hr_dei_del as
2 /* $Header: hrdeirhi.pkb 120.1 2005/09/09 08:32 kramajey noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  hr_dei_del.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< delete_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the actual dml delete logic. The functions of
17 --   this procedure are as follows:
18 --   1) To delete the specified row from the schema using the primary key in
19 --      the predicates.
20 --   2) To trap any constraint violations that may have occurred.
21 --   3) To raise any other errors.
22 --
23 -- Prerequisites:
24 --   This is an internal private procedure which must be called from the del
25 --   procedure.
26 --
27 -- In Parameters:
28 --   A Pl/Sql record structre.
29 --
30 -- Post Success:
31 --   The specified row will be delete from the schema.
32 --
33 -- Post Failure:
34 --   If a child integrity constraint violation is raised the
35 --   constraint_error procedure will be called.
36 --
37 -- Developer Implementation Notes:
38 --   None.
39 --
40 -- Access Status:
41 --   Internal Row Handler Use Only.
42 --
43 -- {End Of Comments}
44 -- ----------------------------------------------------------------------------
45 Procedure delete_dml
46   (p_rec in hr_dei_shd.g_rec_type
47   ) is
48 --
49   l_proc  varchar2(72) := g_package||'delete_dml';
50 --
51 Begin
52   hr_utility.set_location('Entering:'||l_proc, 5);
53   --
54   --
55   --
56   -- Delete the hr_document_extra_info row.
57   --
58   delete from hr_document_extra_info
59   where document_extra_info_id = p_rec.document_extra_info_id;
60   --
61   --
62   --
63   hr_utility.set_location(' Leaving:'||l_proc, 10);
64 --
65 Exception
66   When hr_api.child_integrity_violated then
67     -- Child integrity has been violated
68     --
69     hr_dei_shd.constraint_error
70       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
71   When Others Then
72     --
73     Raise;
74 End delete_dml;
75 --
76 -- ----------------------------------------------------------------------------
77 -- |------------------------------< pre_delete >------------------------------|
78 -- ----------------------------------------------------------------------------
79 -- {Start Of Comments}
80 --
81 -- Description:
82 --   This private procedure contains any processing which is required before
83 --   the delete dml.
84 --
85 -- Prerequisites:
86 --   This is an internal procedure which is called from the del procedure.
87 --
88 -- In Parameters:
89 --   A Pl/Sql record structre.
90 --
91 -- Post Success:
92 --   Processing continues.
93 --
94 -- Post Failure:
95 --   If an error has occurred, an error message and exception will be raised
96 --   but not handled.
97 --
98 -- Developer Implementation Notes:
99 --   Any pre-processing required before the delete dml is issued should be
100 --   coded within this procedure. It is important to note that any 3rd party
101 --   maintenance should be reviewed before placing in this procedure.
102 --
103 -- Access Status:
104 --   Internal Row Handler Use Only.
105 --
106 -- {End Of Comments}
107 -- ----------------------------------------------------------------------------
108 Procedure pre_delete(p_rec in hr_dei_shd.g_rec_type) is
109 --
110   l_proc  varchar2(72) := g_package||'pre_delete';
111 --
112 Begin
113   hr_utility.set_location('Entering:'||l_proc, 5);
114   --
115   hr_utility.set_location(' Leaving:'||l_proc, 10);
116 End pre_delete;
117 --
118 -- ----------------------------------------------------------------------------
119 -- |-----------------------------< post_delete >------------------------------|
120 -- ----------------------------------------------------------------------------
121 -- {Start Of Comments}
122 --
123 -- Description:
124 --   This private procedure contains any processing which is required after
125 --   the delete dml.
126 --
127 -- Prerequistes:
128 --   This is an internal procedure which is called from the del procedure.
129 --
130 -- In Parameters:
131 --   A Pl/Sql record structure.
132 --
133 -- Post Success:
134 --   Processing continues.
135 --
136 -- Post Failure:
137 --   If an error has occurred, an error message and exception will be raised
138 --   but not handled.
139 --
140 -- Developer Implementation Notes:
141 --   Any post-processing required after the delete dml is issued should be
142 --   coded within this procedure. It is important to note that any 3rd party
143 --   maintenance should be reviewed before placing in this procedure.
144 --
145 -- Access Status:
146 --   Internal Row Handler Use Only.
147 --
148 -- {End Of Comments}
149 -- -----------------------------------------------------------------------------
150 Procedure post_delete(p_rec in hr_dei_shd.g_rec_type) is
151 --
152   l_proc  varchar2(72) := g_package||'post_delete';
153 --
154 Begin
155   hr_utility.set_location('Entering:'||l_proc, 5);
156   begin
157     --
158     hr_dei_rkd.after_delete
159       (p_document_extra_info_id
160       => p_rec.document_extra_info_id
161       ,p_person_id_o
162       => hr_dei_shd.g_old_rec.person_id
163       ,p_document_type_id_o
164       => hr_dei_shd.g_old_rec.document_type_id
165       ,p_document_number_o
166       => hr_dei_shd.g_old_rec.document_number
167       ,p_date_from_o
168       => hr_dei_shd.g_old_rec.date_from
169       ,p_date_to_o
170       => hr_dei_shd.g_old_rec.date_to
171       ,p_issued_by_o
172       => hr_dei_shd.g_old_rec.issued_by
173       ,p_issued_at_o
174       => hr_dei_shd.g_old_rec.issued_at
175       ,p_issued_date_o
176       => hr_dei_shd.g_old_rec.issued_date
177       ,p_issuing_authority_o
178       => hr_dei_shd.g_old_rec.issuing_authority
179       ,p_verified_by_o
180       => hr_dei_shd.g_old_rec.verified_by
181       ,p_verified_date_o
182       => hr_dei_shd.g_old_rec.verified_date
183       ,p_related_object_name_o
184       => hr_dei_shd.g_old_rec.related_object_name
185       ,p_related_object_id_col_o
186       => hr_dei_shd.g_old_rec.related_object_id_col
187       ,p_related_object_id_o
188       => hr_dei_shd.g_old_rec.related_object_id
189       ,p_dei_attribute_category_o
190       => hr_dei_shd.g_old_rec.dei_attribute_category
191       ,p_dei_attribute1_o
192       => hr_dei_shd.g_old_rec.dei_attribute1
193       ,p_dei_attribute2_o
194       => hr_dei_shd.g_old_rec.dei_attribute2
195       ,p_dei_attribute3_o
196       => hr_dei_shd.g_old_rec.dei_attribute3
197       ,p_dei_attribute4_o
198       => hr_dei_shd.g_old_rec.dei_attribute4
199       ,p_dei_attribute5_o
200       => hr_dei_shd.g_old_rec.dei_attribute5
201       ,p_dei_attribute6_o
202       => hr_dei_shd.g_old_rec.dei_attribute6
203       ,p_dei_attribute7_o
204       => hr_dei_shd.g_old_rec.dei_attribute7
205       ,p_dei_attribute8_o
206       => hr_dei_shd.g_old_rec.dei_attribute8
207       ,p_dei_attribute9_o
208       => hr_dei_shd.g_old_rec.dei_attribute9
209       ,p_dei_attribute10_o
210       => hr_dei_shd.g_old_rec.dei_attribute10
211       ,p_dei_attribute11_o
212       => hr_dei_shd.g_old_rec.dei_attribute11
213       ,p_dei_attribute12_o
214       => hr_dei_shd.g_old_rec.dei_attribute12
215       ,p_dei_attribute13_o
216       => hr_dei_shd.g_old_rec.dei_attribute13
217       ,p_dei_attribute14_o
218       => hr_dei_shd.g_old_rec.dei_attribute14
219       ,p_dei_attribute15_o
220       => hr_dei_shd.g_old_rec.dei_attribute15
221       ,p_dei_attribute16_o
222       => hr_dei_shd.g_old_rec.dei_attribute16
223       ,p_dei_attribute17_o
224       => hr_dei_shd.g_old_rec.dei_attribute17
225       ,p_dei_attribute18_o
226       => hr_dei_shd.g_old_rec.dei_attribute18
227       ,p_dei_attribute19_o
228       => hr_dei_shd.g_old_rec.dei_attribute19
229       ,p_dei_attribute20_o
230       => hr_dei_shd.g_old_rec.dei_attribute20
231       ,p_dei_attribute21_o
232       => hr_dei_shd.g_old_rec.dei_attribute21
233       ,p_dei_attribute22_o
234       => hr_dei_shd.g_old_rec.dei_attribute22
235       ,p_dei_attribute23_o
236       => hr_dei_shd.g_old_rec.dei_attribute23
237       ,p_dei_attribute24_o
238       => hr_dei_shd.g_old_rec.dei_attribute24
239       ,p_dei_attribute25_o
240       => hr_dei_shd.g_old_rec.dei_attribute25
241       ,p_dei_attribute26_o
242       => hr_dei_shd.g_old_rec.dei_attribute26
243       ,p_dei_attribute27_o
244       => hr_dei_shd.g_old_rec.dei_attribute27
245       ,p_dei_attribute28_o
246       => hr_dei_shd.g_old_rec.dei_attribute28
247       ,p_dei_attribute29_o
248       => hr_dei_shd.g_old_rec.dei_attribute29
249       ,p_dei_attribute30_o
250       => hr_dei_shd.g_old_rec.dei_attribute30
251       ,p_dei_information_category_o
252       => hr_dei_shd.g_old_rec.dei_information_category
253       ,p_dei_information1_o
254       => hr_dei_shd.g_old_rec.dei_information1
255       ,p_dei_information2_o
256       => hr_dei_shd.g_old_rec.dei_information2
257       ,p_dei_information3_o
258       => hr_dei_shd.g_old_rec.dei_information3
259       ,p_dei_information4_o
260       => hr_dei_shd.g_old_rec.dei_information4
261       ,p_dei_information5_o
262       => hr_dei_shd.g_old_rec.dei_information5
263       ,p_dei_information6_o
264       => hr_dei_shd.g_old_rec.dei_information6
265       ,p_dei_information7_o
266       => hr_dei_shd.g_old_rec.dei_information7
267       ,p_dei_information8_o
268       => hr_dei_shd.g_old_rec.dei_information8
269       ,p_dei_information9_o
270       => hr_dei_shd.g_old_rec.dei_information9
271       ,p_dei_information10_o
272       => hr_dei_shd.g_old_rec.dei_information10
273       ,p_dei_information11_o
274       => hr_dei_shd.g_old_rec.dei_information11
275       ,p_dei_information12_o
276       => hr_dei_shd.g_old_rec.dei_information12
277       ,p_dei_information13_o
278       => hr_dei_shd.g_old_rec.dei_information13
279       ,p_dei_information14_o
280       => hr_dei_shd.g_old_rec.dei_information14
281       ,p_dei_information15_o
282       => hr_dei_shd.g_old_rec.dei_information15
283       ,p_dei_information16_o
284       => hr_dei_shd.g_old_rec.dei_information16
285       ,p_dei_information17_o
286       => hr_dei_shd.g_old_rec.dei_information17
287       ,p_dei_information18_o
288       => hr_dei_shd.g_old_rec.dei_information18
289       ,p_dei_information19_o
290       => hr_dei_shd.g_old_rec.dei_information19
291       ,p_dei_information20_o
292       => hr_dei_shd.g_old_rec.dei_information20
293       ,p_dei_information21_o
294       => hr_dei_shd.g_old_rec.dei_information21
295       ,p_dei_information22_o
296       => hr_dei_shd.g_old_rec.dei_information22
297       ,p_dei_information23_o
298       => hr_dei_shd.g_old_rec.dei_information23
299       ,p_dei_information24_o
300       => hr_dei_shd.g_old_rec.dei_information24
301       ,p_dei_information25_o
302       => hr_dei_shd.g_old_rec.dei_information25
303       ,p_dei_information26_o
304       => hr_dei_shd.g_old_rec.dei_information26
305       ,p_dei_information27_o
306       => hr_dei_shd.g_old_rec.dei_information27
307       ,p_dei_information28_o
308       => hr_dei_shd.g_old_rec.dei_information28
309       ,p_dei_information29_o
310       => hr_dei_shd.g_old_rec.dei_information29
311       ,p_dei_information30_o
312       => hr_dei_shd.g_old_rec.dei_information30
313       ,p_request_id_o
314       => hr_dei_shd.g_old_rec.request_id
315       ,p_program_application_id_o
316       => hr_dei_shd.g_old_rec.program_application_id
317       ,p_program_id_o
318       => hr_dei_shd.g_old_rec.program_id
319       ,p_program_update_date_o
320       => hr_dei_shd.g_old_rec.program_update_date
321       ,p_object_version_number_o
322       => hr_dei_shd.g_old_rec.object_version_number
323       );
324     --
325   exception
326     --
327     when hr_api.cannot_find_prog_unit then
328       --
329       hr_api.cannot_find_prog_unit_error
330         (p_module_name => 'HR_DOCUMENT_EXTRA_INFO'
331         ,p_hook_type   => 'AD');
332       --
333   end;
334   --
335   hr_utility.set_location(' Leaving:'||l_proc, 10);
336 End post_delete;
337 --
338 -- ----------------------------------------------------------------------------
339 -- |---------------------------------< del >----------------------------------|
340 -- ----------------------------------------------------------------------------
341 Procedure del
342   (p_rec              in hr_dei_shd.g_rec_type
343   ) is
344 --
345   l_proc  varchar2(72) := g_package||'del';
346 --
347 Begin
348   hr_utility.set_location('Entering:'||l_proc, 5);
349   --
350   -- We must lock the row which we need to delete.
351   --
352   hr_dei_shd.lck
353     (p_rec.document_extra_info_id
354     ,p_rec.object_version_number
355     );
356   --
357   -- Call the supporting delete validate operation
358   --
359   hr_dei_bus.delete_validate(p_rec);
360   --
361   -- Call to raise any errors on multi-message list
362   hr_multi_message.end_validation_set;
363   --
364   -- Call the supporting pre-delete operation
365   --
366   hr_dei_del.pre_delete(p_rec);
367   --
368   -- Delete the row.
369   --
370   hr_dei_del.delete_dml(p_rec);
371   --
372   -- Call the supporting post-delete operation
373   --
374   hr_dei_del.post_delete(p_rec);
375   --
376   -- Call to raise any errors on multi-message list
377   hr_multi_message.end_validation_set;
378   --
379 End del;
380 --
381 -- ----------------------------------------------------------------------------
382 -- |---------------------------------< del >----------------------------------|
383 -- ----------------------------------------------------------------------------
384 Procedure del
385   (p_document_extra_info_id               in     number
386   ,p_object_version_number                in     number
387   ) is
388 --
389   l_rec   hr_dei_shd.g_rec_type;
390   l_proc  varchar2(72) := g_package||'del';
391 --
392 Begin
393   hr_utility.set_location('Entering:'||l_proc, 5);
394   --
395   -- As the delete procedure accepts a plsql record structure we do need to
396   -- convert the  arguments into the record structure.
397   -- We don't need to call the supplied conversion argument routine as we
398   -- only need a few attributes.
399   --
400   l_rec.document_extra_info_id := p_document_extra_info_id;
401   l_rec.object_version_number := p_object_version_number;
402   --
403   -- Having converted the arguments into the hr_dei_rec
404   -- plsql record structure we must call the corresponding entity
405   -- business process
406   --
407   hr_dei_del.del(l_rec);
408   --
409   hr_utility.set_location(' Leaving:'||l_proc, 10);
410 End del;
411 --
412 end hr_dei_del;