DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_PRF_DEL

Source


1 Package Body pay_prf_del as
2 /* $Header: pyprfrhi.pkb 120.0 2005/05/29 07:49 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pay_prf_del.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- ----------------------< delete_app_ownerships >----------------------------|
12 -- ----------------------------------------------------------------------------
13 --
14 -- Description:
15 --   Deletes row(s) from hr_application_ownerships depending on the mode that
16 --   the row handler has been called in.
17 --
18 -- ----------------------------------------------------------------------------
19 PROCEDURE delete_app_ownerships(p_pk_column  IN  varchar2
20                                ,p_pk_value   IN  varchar2) IS
21 --
22 BEGIN
23   --
24   IF (hr_startup_data_api_support.return_startup_mode
25                            IN ('STARTUP','GENERIC')) THEN
26      --
27      DELETE FROM hr_application_ownerships
28       WHERE key_name = p_pk_column
29         AND key_value = p_pk_value;
30      --
31   END IF;
32 END delete_app_ownerships;
33 --
34 -- ----------------------------------------------------------------------------
35 -- ----------------------< delete_app_ownerships >----------------------------|
36 -- ----------------------------------------------------------------------------
37 PROCEDURE delete_app_ownerships(p_pk_column IN varchar2
38                                ,p_pk_value  IN number) IS
39 --
40 BEGIN
41   delete_app_ownerships(p_pk_column, to_char(p_pk_value));
42 END delete_app_ownerships;
43 --
44 -- ----------------------------------------------------------------------------
45 -- |------------------------------< delete_dml >------------------------------|
46 -- ----------------------------------------------------------------------------
47 -- {Start Of Comments}
48 --
49 -- Description:
50 --   This procedure controls the actual dml delete logic. The functions of
51 --   this procedure are as follows:
52 --   1) To set and unset the g_api_dml status as required (as we are about to
53 --      perform dml).
54 --   2) To delete the specified row from the schema using the primary key in
55 --      the predicates.
56 --   3) To trap any constraint violations that may have occurred.
57 --   4) To raise any other errors.
58 --
59 -- Prerequisites:
60 --   This is an internal private procedure which must be called from the del
61 --   procedure.
62 --
63 -- In Parameters:
64 --   A Pl/Sql record structre.
65 --
66 -- Post Success:
67 --   The specified row will be delete from the schema.
68 --
69 -- Post Failure:
70 --   On the delete dml failure it is important to note that we always reset the
71 --   g_api_dml status to false.
72 --   If a child integrity constraint violation is raised the
73 --   constraint_error procedure will be called.
74 --   If any other error is reported, the error will be raised after the
75 --   g_api_dml status is reset.
76 --
77 -- Developer Implementation Notes:
78 --   None.
79 --
80 -- Access Status:
81 --   Internal Row Handler Use Only.
82 --
83 -- {End Of Comments}
84 -- ----------------------------------------------------------------------------
85 Procedure delete_dml
86   (p_rec in pay_prf_shd.g_rec_type
87   ) is
88 --
89   l_proc  varchar2(72) := g_package||'delete_dml';
90 --
91 Begin
92   hr_utility.set_location('Entering:'||l_proc, 5);
93   --
94   --
95   --
96   -- Delete the pay_range_tables_f row.
97   --
98   delete from pay_range_tables_f
99   where range_table_id = p_rec.range_table_id;
100   --
101   --
102   --
103   hr_utility.set_location(' Leaving:'||l_proc, 10);
104 --
105 Exception
106   When hr_api.child_integrity_violated then
107     -- Child integrity has been violated
108     --
109     pay_prf_shd.constraint_error
110       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
111   When Others Then
112     --
113     Raise;
114 End delete_dml;
115 --
116 -- ----------------------------------------------------------------------------
117 -- |------------------------------< pre_delete >------------------------------|
118 -- ----------------------------------------------------------------------------
119 -- {Start Of Comments}
120 --
121 -- Description:
122 --   This private procedure contains any processing which is required before
123 --   the delete dml.
124 --
125 -- Prerequisites:
126 --   This is an internal procedure which is called from the del procedure.
127 --
128 -- In Parameters:
129 --   A Pl/Sql record structre.
130 --
131 -- Post Success:
132 --   Processing continues.
133 --
134 -- Post Failure:
135 --   If an error has occurred, an error message and exception will be raised
136 --   but not handled.
137 --
138 -- Developer Implementation Notes:
139 --   Any pre-processing required before the delete dml is issued should be
140 --   coded within this procedure. It is important to note that any 3rd party
141 --   maintenance should be reviewed before placing in this procedure.
142 --
143 -- Access Status:
144 --   Internal Row Handler Use Only.
145 --
146 -- {End Of Comments}
147 -- ----------------------------------------------------------------------------
148 Procedure pre_delete(p_rec in pay_prf_shd.g_rec_type) is
149 --
150   l_proc  varchar2(72) := g_package||'pre_delete';
151 --
152 Begin
153   hr_utility.set_location('Entering:'||l_proc, 5);
154   --
155   hr_utility.set_location(' Leaving:'||l_proc, 10);
156 End pre_delete;
157 --
158 -- ----------------------------------------------------------------------------
159 -- |-----------------------------< post_delete >------------------------------|
160 -- ----------------------------------------------------------------------------
161 -- {Start Of Comments}
162 --
163 -- Description:
164 --   This private procedure contains any processing which is required after
165 --   the delete dml.
166 --
167 -- Prerequistes:
168 --   This is an internal procedure which is called from the del procedure.
169 --
170 -- In Parameters:
171 --   A Pl/Sql record structure.
172 --
173 -- Post Success:
174 --   Processing continues.
175 --
176 -- Post Failure:
177 --   If an error has occurred, an error message and exception will be raised
178 --   but not handled.
179 --
180 -- Developer Implementation Notes:
181 --   Any post-processing required after the delete dml is issued should be
182 --   coded within this procedure. It is important to note that any 3rd party
183 --   maintenance should be reviewed before placing in this procedure.
184 --
185 -- Access Status:
186 --   Internal Row Handler Use Only.
187 --
188 -- {End Of Comments}
189 -- -----------------------------------------------------------------------------
190 Procedure post_delete(p_rec in pay_prf_shd.g_rec_type) is
191 --
192   l_proc  varchar2(72) := g_package||'post_delete';
193 --
194 Begin
195   hr_utility.set_location('Entering:'||l_proc, 5);
196   begin
197     --
198     -- Delete ownerships if applicable
199     delete_app_ownerships
200       ('RANGE_TABLE_ID', p_rec.range_table_id
201       );
202     --
203     pay_prf_rkd.after_delete
204       (p_range_table_id
205       => p_rec.range_table_id
206       ,p_effective_start_date_o
207       => pay_prf_shd.g_old_rec.effective_start_date
208       ,p_effective_end_date_o
209       => pay_prf_shd.g_old_rec.effective_end_date
210       ,p_range_table_number_o
211       => pay_prf_shd.g_old_rec.range_table_number
212       ,p_row_value_uom_o
213       => pay_prf_shd.g_old_rec.row_value_uom
214       ,p_period_frequency_o
215       => pay_prf_shd.g_old_rec.period_frequency
216       ,p_earnings_type_o
217       => pay_prf_shd.g_old_rec.earnings_type
218       ,p_business_group_id_o
219       => pay_prf_shd.g_old_rec.business_group_id
220       ,p_legislation_code_o
221       => pay_prf_shd.g_old_rec.legislation_code
222       ,p_last_updated_login_o
223       => pay_prf_shd.g_old_rec.last_updated_login
224       ,p_created_date_o
225       => pay_prf_shd.g_old_rec.created_date
226       ,p_object_version_number_o
227       => pay_prf_shd.g_old_rec.object_version_number
228       ,p_attribute_category_o
229       => pay_prf_shd.g_old_rec.attribute_category
230       ,p_attribute1_o
231       => pay_prf_shd.g_old_rec.attribute1
232       ,p_attribute2_o
233       => pay_prf_shd.g_old_rec.attribute2
234       ,p_attribute3_o
235       => pay_prf_shd.g_old_rec.attribute3
236       ,p_attribute4_o
237       => pay_prf_shd.g_old_rec.attribute4
238       ,p_attribute5_o
239       => pay_prf_shd.g_old_rec.attribute5
240       ,p_attribute6_o
241       => pay_prf_shd.g_old_rec.attribute6
242       ,p_attribute7_o
243       => pay_prf_shd.g_old_rec.attribute7
244       ,p_attribute8_o
245       => pay_prf_shd.g_old_rec.attribute8
246       ,p_attribute9_o
247       => pay_prf_shd.g_old_rec.attribute9
248       ,p_attribute10_o
249       => pay_prf_shd.g_old_rec.attribute10
250       ,p_attribute11_o
251       => pay_prf_shd.g_old_rec.attribute11
252       ,p_attribute12_o
253       => pay_prf_shd.g_old_rec.attribute12
254       ,p_attribute13_o
255       => pay_prf_shd.g_old_rec.attribute13
256       ,p_attribute14_o
257       => pay_prf_shd.g_old_rec.attribute14
258       ,p_attribute15_o
259       => pay_prf_shd.g_old_rec.attribute15
260       ,p_attribute16_o
261       => pay_prf_shd.g_old_rec.attribute16
262       ,p_attribute17_o
263       => pay_prf_shd.g_old_rec.attribute17
264       ,p_attribute18_o
265       => pay_prf_shd.g_old_rec.attribute18
266       ,p_attribute19_o
267       => pay_prf_shd.g_old_rec.attribute19
268       ,p_attribute20_o
269       => pay_prf_shd.g_old_rec.attribute20
270       ,p_attribute21_o
271       => pay_prf_shd.g_old_rec.attribute21
272       ,p_attribute22_o
273       => pay_prf_shd.g_old_rec.attribute22
274       ,p_attribute23_o
275       => pay_prf_shd.g_old_rec.attribute23
276       ,p_attribute24_o
277       => pay_prf_shd.g_old_rec.attribute24
278       ,p_attribute25_o
279       => pay_prf_shd.g_old_rec.attribute25
280       ,p_attribute26_o
281       => pay_prf_shd.g_old_rec.attribute26
282       ,p_attribute27_o
283       => pay_prf_shd.g_old_rec.attribute27
284       ,p_attribute28_o
285       => pay_prf_shd.g_old_rec.attribute28
286       ,p_attribute29_o
287       => pay_prf_shd.g_old_rec.attribute29
288       ,p_attribute30_o
289       => pay_prf_shd.g_old_rec.attribute30
290       ,p_ran_information_category_o
291       => pay_prf_shd.g_old_rec.ran_information_category
292       ,p_ran_information1_o
293       => pay_prf_shd.g_old_rec.ran_information1
294       ,p_ran_information2_o
295       => pay_prf_shd.g_old_rec.ran_information2
296       ,p_ran_information3_o
297       => pay_prf_shd.g_old_rec.ran_information3
298       ,p_ran_information4_o
299       => pay_prf_shd.g_old_rec.ran_information4
300       ,p_ran_information5_o
301       => pay_prf_shd.g_old_rec.ran_information5
302       ,p_ran_information6_o
303       => pay_prf_shd.g_old_rec.ran_information6
304       ,p_ran_information7_o
305       => pay_prf_shd.g_old_rec.ran_information7
306       ,p_ran_information8_o
307       => pay_prf_shd.g_old_rec.ran_information8
308       ,p_ran_information9_o
309       => pay_prf_shd.g_old_rec.ran_information9
310       ,p_ran_information10_o
311       => pay_prf_shd.g_old_rec.ran_information10
312       ,p_ran_information11_o
313       => pay_prf_shd.g_old_rec.ran_information11
314       ,p_ran_information12_o
315       => pay_prf_shd.g_old_rec.ran_information12
316       ,p_ran_information13_o
317       => pay_prf_shd.g_old_rec.ran_information13
318       ,p_ran_information14_o
319       => pay_prf_shd.g_old_rec.ran_information14
320       ,p_ran_information15_o
321       => pay_prf_shd.g_old_rec.ran_information15
322       ,p_ran_information16_o
323       => pay_prf_shd.g_old_rec.ran_information16
324       ,p_ran_information17_o
325       => pay_prf_shd.g_old_rec.ran_information17
326       ,p_ran_information18_o
327       => pay_prf_shd.g_old_rec.ran_information18
328       ,p_ran_information19_o
329       => pay_prf_shd.g_old_rec.ran_information19
330       ,p_ran_information20_o
331       => pay_prf_shd.g_old_rec.ran_information20
332       ,p_ran_information21_o
333       => pay_prf_shd.g_old_rec.ran_information21
334       ,p_ran_information22_o
335       => pay_prf_shd.g_old_rec.ran_information22
336       ,p_ran_information23_o
337       => pay_prf_shd.g_old_rec.ran_information23
338       ,p_ran_information24_o
339       => pay_prf_shd.g_old_rec.ran_information24
340       ,p_ran_information25_o
341       => pay_prf_shd.g_old_rec.ran_information25
342       ,p_ran_information26_o
343       => pay_prf_shd.g_old_rec.ran_information26
344       ,p_ran_information27_o
345       => pay_prf_shd.g_old_rec.ran_information27
346       ,p_ran_information28_o
347       => pay_prf_shd.g_old_rec.ran_information28
348       ,p_ran_information29_o
349       => pay_prf_shd.g_old_rec.ran_information29
350       ,p_ran_information30_o
351       => pay_prf_shd.g_old_rec.ran_information30
352       );
353     --
354   exception
355     --
356     when hr_api.cannot_find_prog_unit then
357       --
358       hr_api.cannot_find_prog_unit_error
359         (p_module_name => 'PAY_RANGE_TABLES_F'
360         ,p_hook_type   => 'AD');
361       --
362   end;
363   --
364   hr_utility.set_location(' Leaving:'||l_proc, 10);
365 End post_delete;
366 --
367 -- ----------------------------------------------------------------------------
368 -- |---------------------------------< del >----------------------------------|
369 -- ----------------------------------------------------------------------------
370 Procedure del
371   (p_rec              in pay_prf_shd.g_rec_type
372   ) is
373 --
374   l_proc  varchar2(72) := g_package||'del';
375 --
376 Begin
377   hr_utility.set_location('Entering:'||l_proc, 5);
378   --
379   -- We must lock the row which we need to delete.
380   --
381   pay_prf_shd.lck
382     (p_rec.range_table_id
383     ,p_rec.object_version_number
384     );
385   --
386   -- Call the supporting delete validate operation
387   --
388   pay_prf_bus.delete_validate(p_rec);
389   --
390   -- Call to raise any errors on multi-message list
391   hr_multi_message.end_validation_set;
392   --
393   -- Call the supporting pre-delete operation
394   --
395   pay_prf_del.pre_delete(p_rec);
396   --
397   -- Delete the row.
398   --
399   pay_prf_del.delete_dml(p_rec);
400   --
401   -- Call the supporting post-delete operation
402   --
403  -- Commented Because not supported as of now.
404  /*
405  pay_prf_del.post_delete(p_rec);
406  */
407   --
408   -- Call to raise any errors on multi-message list
409   hr_multi_message.end_validation_set;
410   --
411 End del;
412 --
413 -- ----------------------------------------------------------------------------
414 -- |---------------------------------< del >----------------------------------|
415 -- ----------------------------------------------------------------------------
416 Procedure del
417   (p_range_table_id                       in     number
418   ,p_object_version_number                in     number
419   ) is
420 --
421   l_rec   pay_prf_shd.g_rec_type;
422   l_proc  varchar2(72) := g_package||'del';
423 --
424 Begin
425   hr_utility.set_location('Entering:'||l_proc, 5);
426   --
427   -- As the delete procedure accepts a plsql record structure we do need to
428   -- convert the  arguments into the record structure.
429   -- We don't need to call the supplied conversion argument routine as we
430   -- only need a few attributes.
431   --
432   l_rec.range_table_id := p_range_table_id;
433   l_rec.object_version_number := p_object_version_number;
434   --
435   -- Having converted the arguments into the pay_prf_rec
436   -- plsql record structure we must call the corresponding entity
437   -- business process
438   --
439   pay_prf_del.del(l_rec);
440   --
441   hr_utility.set_location(' Leaving:'||l_proc, 10);
442 End del;
443 --
444 end pay_prf_del;