DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PAC_DEL

Source


1 Package Body per_pac_del as
2 /* $Header: pepacrhi.pkb 120.3 2006/10/19 07:29:26 sturlapa noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := '  per_pac_del.';  -- Global package name
9 g_debug   boolean      := hr_utility.debug_enabled;
10 --
11 -- ----------------------------------------------------------------------------
12 -- |------------------------------< delete_dml >------------------------------|
13 -- ----------------------------------------------------------------------------
14 -- {Start Of Comments}
15 --
16 -- Description:
17 --   This procedure controls the actual dml delete logic. The functions of
18 --   this procedure are 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) To delete the specified row from the schema using the primary key in
22 --      the predicates.
23 --   3) To trap any constraint violations that may have occurred.
24 --   4) To raise any other errors.
25 --
26 -- Prerequisites:
27 --   This is an internal private procedure which must be called from the del
28 --   procedure.
29 --
30 -- In Parameters:
31 --   A Pl/Sql record structre.
32 --
33 -- Post Success:
34 --   The specified row will be delete from the schema.
35 --
36 -- Post Failure:
37 --   On the delete dml failure it is important to note that we always reset the
38 --   g_api_dml status to false.
39 --   If a child integrity constraint violation is raised the
40 --   constraint_error procedure will be called.
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 --   None.
46 --
47 -- Access Status:
48 --   Internal Row Handler Use Only.
49 --
50 -- {End Of Comments}
51 -- ----------------------------------------------------------------------------
52 Procedure delete_dml
53   (p_rec in per_pac_shd.g_rec_type
54   ) is
55 --
56   l_proc  varchar2(72) := g_package||'delete_dml';
57 --
58 Begin
59   hr_utility.set_location('Entering:'||l_proc, 5);
60   --
61   --
62   --
63   -- Delete the per_allocated_checklists row.
64   --
65   delete from per_allocated_checklists
66   where allocated_checklist_id = p_rec.allocated_checklist_id;
67   --
68   --
69   --
70   hr_utility.set_location(' Leaving:'||l_proc, 10);
71 --
72 Exception
73   When hr_api.child_integrity_violated then
74     -- Child integrity has been violated
75     --
76     per_pac_shd.constraint_error
77       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
78   When Others Then
79     --
80     Raise;
81 End delete_dml;
82 --
83 -- ----------------------------------------------------------------------------
84 -- |------------------------------< pre_delete >------------------------------|
85 -- ----------------------------------------------------------------------------
86 -- {Start Of Comments}
87 --
88 -- Description:
89 --   This private procedure contains any processing which is required before
90 --   the delete dml.
91 --
92 -- Prerequisites:
93 --   This is an internal procedure which is called from the del procedure.
94 --
95 -- In Parameters:
96 --   A Pl/Sql record structre.
97 --
98 -- Post Success:
99 --   Processing continues.
100 --
101 -- Post Failure:
102 --   If an error has occurred, an error message and exception will be raised
103 --   but not handled.
104 --
105 -- Developer Implementation Notes:
106 --   Any pre-processing required before the delete dml is issued should be
107 --   coded within this procedure. It is important to note that any 3rd party
108 --   maintenance should be reviewed before placing in this procedure.
109 --
110 -- Access Status:
111 --   Internal Row Handler Use Only.
112 --
113 -- {End Of Comments}
114 -- ----------------------------------------------------------------------------
115 Procedure pre_delete(p_rec in per_pac_shd.g_rec_type) is
116 --
117   l_proc  varchar2(72) := g_package||'pre_delete';
118 --
119 Begin
120   hr_utility.set_location('Entering:'||l_proc, 5);
121   --
122   hr_utility.set_location(' Leaving:'||l_proc, 10);
123 End pre_delete;
124 --
125 -- ----------------------------------------------------------------------------
126 -- |-----------------------------< post_delete >------------------------------|
127 -- ----------------------------------------------------------------------------
128 -- {Start Of Comments}
129 --
130 -- Description:
131 --   This private procedure contains any processing which is required after
132 --   the delete dml.
133 --
134 -- Prerequistes:
135 --   This is an internal procedure which is called from the del procedure.
136 --
137 -- In Parameters:
138 --   A Pl/Sql record structure.
139 --
140 -- Post Success:
141 --   Processing continues.
142 --
143 -- Post Failure:
144 --   If an error has occurred, an error message and exception will be raised
145 --   but not handled.
146 --
147 -- Developer Implementation Notes:
148 --   Any post-processing required after the delete dml is issued should be
149 --   coded within this procedure. It is important to note that any 3rd party
150 --   maintenance should be reviewed before placing in this procedure.
151 --
152 -- Access Status:
153 --   Internal Row Handler Use Only.
154 --
155 -- {End Of Comments}
156 -- -----------------------------------------------------------------------------
157 Procedure post_delete(p_rec in per_pac_shd.g_rec_type) is
158 --
159   l_proc  varchar2(72) := g_package||'post_delete';
160 --
161 Begin
162   hr_utility.set_location('Entering:'||l_proc, 5);
163   begin
164     --
165     per_pac_rkd.after_delete
166       (p_allocated_checklist_id
167       => p_rec.allocated_checklist_id
168       ,p_checklist_id_o
169       => per_pac_shd.g_old_rec.checklist_id
170       ,p_person_id_o
171       => per_pac_shd.g_old_rec.person_id
172       ,p_assignment_id_o
173       => per_pac_shd.g_old_rec.assignment_id
174       ,p_checklist_name_o
175       => per_pac_shd.g_old_rec.checklist_name
176       ,p_description_o
177       => per_pac_shd.g_old_rec.description
178       ,p_checklist_category_o
179       => per_pac_shd.g_old_rec.checklist_category
180       ,p_object_version_number_o
181       => per_pac_shd.g_old_rec.object_version_number
182       ,p_attribute_category_o
183       => per_pac_shd.g_old_rec.attribute_category
184       ,p_attribute1_o
185       => per_pac_shd.g_old_rec.attribute1
186       ,p_attribute2_o
187       => per_pac_shd.g_old_rec.attribute2
188       ,p_attribute3_o
189       => per_pac_shd.g_old_rec.attribute3
190       ,p_attribute4_o
191       => per_pac_shd.g_old_rec.attribute4
192       ,p_attribute5_o
193       => per_pac_shd.g_old_rec.attribute5
194       ,p_attribute6_o
195       => per_pac_shd.g_old_rec.attribute6
196       ,p_attribute7_o
197       => per_pac_shd.g_old_rec.attribute7
198       ,p_attribute8_o
199       => per_pac_shd.g_old_rec.attribute8
200       ,p_attribute9_o
201       => per_pac_shd.g_old_rec.attribute9
202       ,p_attribute10_o
203       => per_pac_shd.g_old_rec.attribute10
204       ,p_attribute11_o
205       => per_pac_shd.g_old_rec.attribute11
206       ,p_attribute12_o
207       => per_pac_shd.g_old_rec.attribute12
208       ,p_attribute13_o
209       => per_pac_shd.g_old_rec.attribute13
210       ,p_attribute14_o
211       => per_pac_shd.g_old_rec.attribute14
212       ,p_attribute15_o
213       => per_pac_shd.g_old_rec.attribute15
214       ,p_attribute16_o
215       => per_pac_shd.g_old_rec.attribute16
216       ,p_attribute17_o
217       => per_pac_shd.g_old_rec.attribute17
218       ,p_attribute18_o
219       => per_pac_shd.g_old_rec.attribute18
220       ,p_attribute19_o
221       => per_pac_shd.g_old_rec.attribute19
222       ,p_attribute20_o
223       => per_pac_shd.g_old_rec.attribute20
224       ,p_information_category_o
225       => per_pac_shd.g_old_rec.information_category
226       ,p_information1_o
227       => per_pac_shd.g_old_rec.information1
228       ,p_information2_o
229       => per_pac_shd.g_old_rec.information2
230       ,p_information3_o
231       => per_pac_shd.g_old_rec.information3
232       ,p_information4_o
233       => per_pac_shd.g_old_rec.information4
234       ,p_information5_o
235       => per_pac_shd.g_old_rec.information5
236       ,p_information6_o
237       => per_pac_shd.g_old_rec.information6
238       ,p_information7_o
239       => per_pac_shd.g_old_rec.information7
240       ,p_information8_o
241       => per_pac_shd.g_old_rec.information8
242       ,p_information9_o
243       => per_pac_shd.g_old_rec.information9
244       ,p_information10_o
245       => per_pac_shd.g_old_rec.information10
246       ,p_information11_o
247       => per_pac_shd.g_old_rec.information11
248       ,p_information12_o
249       => per_pac_shd.g_old_rec.information12
250       ,p_information13_o
251       => per_pac_shd.g_old_rec.information13
252       ,p_information14_o
253       => per_pac_shd.g_old_rec.information14
254       ,p_information15_o
255       => per_pac_shd.g_old_rec.information15
256       ,p_information16_o
257       => per_pac_shd.g_old_rec.information16
258       ,p_information17_o
259       => per_pac_shd.g_old_rec.information17
260       ,p_information18_o
261       => per_pac_shd.g_old_rec.information18
262       ,p_information19_o
263       => per_pac_shd.g_old_rec.information19
264       ,p_information20_o
265       => per_pac_shd.g_old_rec.information20
266       );
267     --
268   exception
269     --
270     when hr_api.cannot_find_prog_unit then
271       --
272       hr_api.cannot_find_prog_unit_error
273         (p_module_name => 'PER_ALLOCATED_CHECKLISTS'
274         ,p_hook_type   => 'AD');
275       --
276   end;
277   --
278   hr_utility.set_location(' Leaving:'||l_proc, 10);
279 End post_delete;
280 --
281 -- ----------------------------------------------------------------------------
282 -- |---------------------------------< del >----------------------------------|
283 -- ----------------------------------------------------------------------------
284 Procedure del
285   (p_rec              in per_pac_shd.g_rec_type
286   ) is
287 --
288   l_proc  varchar2(72) := g_package||'del';
289 --
290 Begin
291   hr_utility.set_location('Entering:'||l_proc, 5);
292   --
293   -- We must lock the row which we need to delete.
294   --
295   per_pac_shd.lck
296     (p_rec.allocated_checklist_id
297     ,p_rec.object_version_number
298     );
299   --
300   -- Call the supporting delete validate operation
301   --
302   per_pac_bus.delete_validate(p_rec);
303   --
304   -- Call to raise any errors on multi-message list
305   hr_multi_message.end_validation_set;
306   --
307   -- Call the supporting pre-delete operation
308   --
309   per_pac_del.pre_delete(p_rec);
310   --
311   -- Delete the row.
312   --
313   per_pac_del.delete_dml(p_rec);
314   --
315   -- Call the supporting post-delete operation
316   --
317   per_pac_del.post_delete(p_rec);
318   --
319   -- Call to raise any errors on multi-message list
320   hr_multi_message.end_validation_set;
321   --
322 End del;
323 --
324 -- ----------------------------------------------------------------------------
325 -- |---------------------------------< del >----------------------------------|
326 -- ----------------------------------------------------------------------------
327 Procedure del
328   (p_allocated_checklist_id               in     number
329   ,p_object_version_number                in     number
330   ) is
331 --
332   l_rec   per_pac_shd.g_rec_type;
333   l_proc  varchar2(72) := g_package||'del';
334 --
335 Begin
336   hr_utility.set_location('Entering:'||l_proc, 5);
337   --
338   -- As the delete procedure accepts a plsql record structure we do need to
339   -- convert the  arguments into the record structure.
340   -- We don't need to call the supplied conversion argument routine as we
341   -- only need a few attributes.
342   --
343   l_rec.allocated_checklist_id := p_allocated_checklist_id;
344   l_rec.object_version_number := p_object_version_number;
345   --
346   -- Having converted the arguments into the per_pac_rec
347   -- plsql record structure we must call the corresponding entity
348   -- business process
349   --
350   per_pac_del.del(l_rec);
351   --
352   hr_utility.set_location(' Leaving:'||l_proc, 10);
353 End del;
354 --
355 end per_pac_del;