DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_ITP_DEL

Source


1 Package Body hr_itp_del as
2 /* $Header: hritprhi.pkb 120.1 2011/04/28 11:51:30 sidsaxen ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  hr_itp_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 set and unset the g_api_dml status as required (as we are about to
19 --      perform dml).
20 --   2) To delete the specified row from the schema using the primary key in
21 --      the predicates.
22 --   3) To trap any constraint violations that may have occurred.
23 --   4) To raise any other errors.
24 --
25 -- Prerequisites:
26 --   This is an internal private procedure which must be called from the del
27 --   procedure.
28 --
29 -- In Parameters:
30 --   A Pl/Sql record structre.
31 --
32 -- Post Success:
33 --   The specified row will be delete from the schema.
34 --
35 -- Post Failure:
36 --   On the delete dml failure it is important to note that we always reset the
37 --   g_api_dml status to false.
38 --   If a child integrity constraint violation is raised the
39 --   constraint_error procedure will be called.
40 --   If any other error is reported, the error will be raised after the
41 --   g_api_dml status is reset.
42 --
43 -- Developer Implementation Notes:
44 --   None.
45 --
46 -- Access Status:
47 --   Internal Row Handler Use Only.
48 --
49 -- {End Of Comments}
50 -- ----------------------------------------------------------------------------
51 Procedure delete_dml
52   (p_rec in hr_itp_shd.g_rec_type
53   ) is
54 --
55   l_proc  varchar2(72) := g_package||'delete_dml';
56 --
57 Begin
58   hr_utility.set_location('Entering:'||l_proc, 5);
59   --
60   --
61   -- Added the following code as a part of Zero Downtime Patching Project.
62   -- Code Starts Here.
63   --
64   --
65   per_ric_pkg.Chk_integrity(
66     p_entity_name=>'HR_ITEM_PROPERTIES_B',
67     p_ref_entity=>'HR_ITEM_PROPERTIES_TL',
68     p_ref_column_name=>'ITEM_PROPERTY_ID',
69     p_ref_col_value_varchar=> NULL,
70     p_ref_col_value_number=> p_rec.item_property_id,
71     p_ref_col_value_date=> NULL,
72     p_ref_type=>'DEL');
73   --
74   -- Code Ends Here
75   --
76   --
77   -- Delete the hr_item_properties_b row.
78   --
79   delete from hr_item_properties_b
80   where item_property_id = p_rec.item_property_id;
81   --
82   --
83   --
84   hr_utility.set_location(' Leaving:'||l_proc, 10);
85 --
86 Exception
87   When hr_api.child_integrity_violated then
88     -- Child integrity has been violated
89     --
90     hr_itp_shd.constraint_error
91       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
92   When Others Then
93     --
94     Raise;
95 End delete_dml;
96 --
97 -- ----------------------------------------------------------------------------
98 -- |------------------------------< pre_delete >------------------------------|
99 -- ----------------------------------------------------------------------------
100 -- {Start Of Comments}
101 --
102 -- Description:
103 --   This private procedure contains any processing which is required before
104 --   the delete dml.
105 --
106 -- Prerequisites:
107 --   This is an internal procedure which is called from the del procedure.
108 --
109 -- In Parameters:
110 --   A Pl/Sql record structre.
111 --
112 -- Post Success:
113 --   Processing continues.
114 --
115 -- Post Failure:
116 --   If an error has occurred, an error message and exception will be raised
117 --   but not handled.
118 --
119 -- Developer Implementation Notes:
120 --   Any pre-processing required before the delete dml is issued should be
121 --   coded within this procedure. It is important to note that any 3rd party
122 --   maintenance should be reviewed before placing in this procedure.
123 --
124 -- Access Status:
125 --   Internal Row Handler Use Only.
126 --
127 -- {End Of Comments}
128 -- ----------------------------------------------------------------------------
129 Procedure pre_delete(p_rec in hr_itp_shd.g_rec_type) is
130 --
131   l_proc  varchar2(72) := g_package||'pre_delete';
132 --
133 Begin
134   hr_utility.set_location('Entering:'||l_proc, 5);
135   --
136   hr_utility.set_location(' Leaving:'||l_proc, 10);
137 End pre_delete;
138 --
139 -- ----------------------------------------------------------------------------
140 -- |-----------------------------< post_delete >------------------------------|
141 -- ----------------------------------------------------------------------------
142 -- {Start Of Comments}
143 --
144 -- Description:
145 --   This private procedure contains any processing which is required after the
146 --   delete dml.
147 --
148 -- Prerequistes:
149 --   This is an internal procedure which is called from the del procedure.
150 --
151 -- In Parameters:
152 --   A Pl/Sql record structure.
153 --
154 -- Post Success:
155 --   Processing continues.
156 --
157 -- Post Failure:
158 --   If an error has occurred, an error message and exception will be raised
159 --   but not handled.
160 --
161 -- Developer Implementation Notes:
162 --   Any post-processing required after the delete dml is issued should be
163 --   coded within this procedure. It is important to note that any 3rd party
164 --   maintenance should be reviewed before placing in this procedure.
165 --
166 -- Access Status:
167 --   Internal Row Handler Use Only.
168 --
169 -- {End Of Comments}
170 -- -----------------------------------------------------------------------------
171 Procedure post_delete(p_rec in hr_itp_shd.g_rec_type) is
172 --
173   l_proc  varchar2(72) := g_package||'post_delete';
174 --
175 Begin
176   hr_utility.set_location('Entering:'||l_proc, 5);
177     begin
178     --
179     hr_itp_rkd.after_delete
180       (p_item_property_id
181       => p_rec.item_property_id
182       ,p_object_version_number_o
183       => hr_itp_shd.g_old_rec.object_version_number
184       ,p_form_item_id_o
185       => hr_itp_shd.g_old_rec.form_item_id
186       ,p_template_item_id_o
187       => hr_itp_shd.g_old_rec.template_item_id
188       ,p_template_item_context_id_o
189       => hr_itp_shd.g_old_rec.template_item_context_id
190       ,p_alignment_o
191       => hr_itp_shd.g_old_rec.alignment
192       ,p_bevel_o
193       => hr_itp_shd.g_old_rec.bevel
194       ,p_case_restriction_o
195       => hr_itp_shd.g_old_rec.case_restriction
196       ,p_enabled_o
197       => hr_itp_shd.g_old_rec.enabled
198       ,p_format_mask_o
199       => hr_itp_shd.g_old_rec.format_mask
200       ,p_height_o
201       => hr_itp_shd.g_old_rec.height
202       ,p_information_formula_id_o
203       => hr_itp_shd.g_old_rec.information_formula_id
207       => hr_itp_shd.g_old_rec.information_parameter_item_id2
204       ,p_information_param_item_id1_o
205       => hr_itp_shd.g_old_rec.information_parameter_item_id1
206       ,p_information_param_item_id2_o
208       ,p_information_param_item_id3_o
209       => hr_itp_shd.g_old_rec.information_parameter_item_id3
210       ,p_information_param_item_id4_o
211       => hr_itp_shd.g_old_rec.information_parameter_item_id4
212       ,p_information_param_item_id5_o
213       => hr_itp_shd.g_old_rec.information_parameter_item_id5
214       ,p_insert_allowed_o
215       => hr_itp_shd.g_old_rec.insert_allowed
216       ,p_prompt_alignment_offset_o
217       => hr_itp_shd.g_old_rec.prompt_alignment_offset
218       ,p_prompt_display_style_o
219       => hr_itp_shd.g_old_rec.prompt_display_style
220       ,p_prompt_edge_o
221       => hr_itp_shd.g_old_rec.prompt_edge
222       ,p_prompt_edge_alignment_o
223       => hr_itp_shd.g_old_rec.prompt_edge_alignment
224       ,p_prompt_edge_offset_o
225       => hr_itp_shd.g_old_rec.prompt_edge_offset
226       ,p_prompt_text_alignment_o
227       => hr_itp_shd.g_old_rec.prompt_text_alignment
228       ,p_query_allowed_o
229       => hr_itp_shd.g_old_rec.query_allowed
230       ,p_required_o
231       => hr_itp_shd.g_old_rec.required
232       ,p_update_allowed_o
233       => hr_itp_shd.g_old_rec.update_allowed
234       ,p_validation_formula_id_o
235       => hr_itp_shd.g_old_rec.validation_formula_id
236       ,p_validation_param_item_id1_o
237       => hr_itp_shd.g_old_rec.validation_parameter_item_id1
238       ,p_validation_param_item_id2_o
239       => hr_itp_shd.g_old_rec.validation_parameter_item_id2
240       ,p_validation_param_item_id3_o
241       => hr_itp_shd.g_old_rec.validation_parameter_item_id3
242       ,p_validation_param_item_id4_o
243       => hr_itp_shd.g_old_rec.validation_parameter_item_id4
244       ,p_validation_param_item_id5_o
245       => hr_itp_shd.g_old_rec.validation_parameter_item_id5
246       ,p_visible_o
247       => hr_itp_shd.g_old_rec.visible
248       ,p_width_o
249       => hr_itp_shd.g_old_rec.width
250       ,p_x_position_o
251       => hr_itp_shd.g_old_rec.x_position
252       ,p_y_position_o
253       => hr_itp_shd.g_old_rec.y_position
254       ,p_information_category_o
255       => hr_itp_shd.g_old_rec.information_category
256       ,p_information1_o
257       => hr_itp_shd.g_old_rec.information1
258       ,p_information2_o
259       => hr_itp_shd.g_old_rec.information2
260       ,p_information3_o
261       => hr_itp_shd.g_old_rec.information3
262       ,p_information4_o
263       => hr_itp_shd.g_old_rec.information4
264       ,p_information5_o
265       => hr_itp_shd.g_old_rec.information5
266       ,p_information6_o
267       => hr_itp_shd.g_old_rec.information6
268       ,p_information7_o
269       => hr_itp_shd.g_old_rec.information7
270       ,p_information8_o
271       => hr_itp_shd.g_old_rec.information8
272       ,p_information9_o
273       => hr_itp_shd.g_old_rec.information9
274       ,p_information10_o
275       => hr_itp_shd.g_old_rec.information10
276       ,p_information11_o
277       => hr_itp_shd.g_old_rec.information11
278       ,p_information12_o
279       => hr_itp_shd.g_old_rec.information12
280       ,p_information13_o
281       => hr_itp_shd.g_old_rec.information13
282       ,p_information14_o
283       => hr_itp_shd.g_old_rec.information14
284       ,p_information15_o
285       => hr_itp_shd.g_old_rec.information15
286       ,p_information16_o
287       => hr_itp_shd.g_old_rec.information16
288       ,p_information17_o
289       => hr_itp_shd.g_old_rec.information17
290       ,p_information18_o
291       => hr_itp_shd.g_old_rec.information18
292       ,p_information19_o
293       => hr_itp_shd.g_old_rec.information19
294       ,p_information20_o
295       => hr_itp_shd.g_old_rec.information20
296       ,p_information21_o
297       => hr_itp_shd.g_old_rec.information21
298       ,p_information22_o
299       => hr_itp_shd.g_old_rec.information22
300       ,p_information23_o
301       => hr_itp_shd.g_old_rec.information23
302       ,p_information24_o
303       => hr_itp_shd.g_old_rec.information24
304       ,p_information25_o
305       => hr_itp_shd.g_old_rec.information25
306       ,p_information26_o
307       => hr_itp_shd.g_old_rec.information26
308       ,p_information27_o
309       => hr_itp_shd.g_old_rec.information27
310       ,p_information28_o
311       => hr_itp_shd.g_old_rec.information28
312       ,p_information29_o
313       => hr_itp_shd.g_old_rec.information29
314       ,p_information30_o
315       => hr_itp_shd.g_old_rec.information30
316       ,p_next_navigation_item_id_o
317       => hr_itp_shd.g_old_rec.next_navigation_item_id
318       ,p_prev_navigation_item_id_o
319       => hr_itp_shd.g_old_rec.previous_navigation_item_id
320       );
321     --
322   exception
323     --
324     when hr_api.cannot_find_prog_unit then
325       --
326       hr_api.cannot_find_prog_unit_error
327         (p_module_name => 'HR_ITEM_PROPERTIES_B'
328         ,p_hook_type   => 'AD');
329       --
330   end;
331   --
332   hr_utility.set_location(' Leaving:'||l_proc, 10);
333 End post_delete;
334 --
335 -- ----------------------------------------------------------------------------
336 -- |---------------------------------< del >----------------------------------|
337 -- ----------------------------------------------------------------------------
338 Procedure del
339   (p_rec        in hr_itp_shd.g_rec_type
340   ) is
341 --
342   l_proc  varchar2(72) := g_package||'del';
343 --
344 Begin
345   hr_utility.set_location('Entering:'||l_proc, 5);
346   --
347   -- We must lock the row which we need to delete.
348   --
349   hr_itp_shd.lck
350     (p_rec.item_property_id
351     ,p_rec.object_version_number
352     );
353   --
354   -- Call the supporting delete validate operation
355   --
356   hr_itp_bus.delete_validate(p_rec);
357   --
358   -- Call the supporting pre-delete operation
359   --
360   hr_itp_del.pre_delete(p_rec);
361   --
362   -- Delete the row.
363   --
364   hr_itp_del.delete_dml(p_rec);
365   --
366   -- Call the supporting post-delete operation
367   --
368   hr_itp_del.post_delete(p_rec);
369   --
370 End del;
371 --
372 -- ----------------------------------------------------------------------------
373 -- |---------------------------------< del >----------------------------------|
374 -- ----------------------------------------------------------------------------
375 Procedure del
376   (p_item_property_id                     in     number
377   ,p_object_version_number                in     number
378   ) is
379 --
380   l_rec   hr_itp_shd.g_rec_type;
381   l_proc  varchar2(72) := g_package||'del';
382 --
383 Begin
384   hr_utility.set_location('Entering:'||l_proc, 5);
385   --
386   -- As the delete procedure accepts a plsql record structure we do need to
387   -- convert the  arguments into the record structure.
388   -- We don't need to call the supplied conversion argument routine as we
389   -- only need a few attributes.
390   --
391   l_rec.item_property_id := p_item_property_id;
392   l_rec.object_version_number := p_object_version_number;
393   --
394   --
395   -- Having converted the arguments into the hr_itp_rec
396   -- plsql record structure we must call the corresponding entity
397   -- business process
398   --
399   hr_itp_del.del(l_rec);
400   --
401   hr_utility.set_location(' Leaving:'||l_proc, 10);
402 End del;
403 --
404 end hr_itp_del;