DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_RET_DEL

Source


1 Package Body per_ret_del as
2 /* $Header: peretrhi.pkb 115.1 2002/12/06 11:29:20 eumenyio noship $ */
3 
4 --
5 -- ----------------------------------------------------------------------------
6 -- |                     Private Global Definitions                           |
7 -- ----------------------------------------------------------------------------
8 --
9 g_package  varchar2(33) := '  per_ret_del.';  -- Global package name
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_ret_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_cagr_retained_rights row.
64   --
65   delete from per_cagr_retained_rights
66   where cagr_retained_right_id = p_rec.cagr_retained_right_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_ret_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_ret_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_ret_shd.g_rec_type) is
158 --
159   l_proc  varchar2(72) := g_package||'post_delete';
160 --
161 Begin
162 /*
163   hr_utility.set_location('Entering:'||l_proc, 5);
164   begin
165     --
166     per_ret_rkd.after_delete
167       (p_cagr_retained_right_id
168       => p_rec.cagr_retained_right_id
169       ,p_assignment_id_o
170       => per_ret_shd.g_old_rec.assignment_id
171       ,p_cagr_entitlement_item_id_o
172       => per_ret_shd.g_old_rec.cagr_entitlement_item_id
173       ,p_collective_agreement_id_o
174       => per_ret_shd.g_old_rec.collective_agreement_id
175       ,p_cagr_entitlement_id_o
176       => per_ret_shd.g_old_rec.cagr_entitlement_id
177       ,p_category_name_o
178       => per_ret_shd.g_old_rec.category_name
179       ,p_element_type_id_o
180       => per_ret_shd.g_old_rec.element_type_id
181       ,p_input_value_id_o
182       => per_ret_shd.g_old_rec.input_value_id
183       ,p_cagr_api_id_o
184       => per_ret_shd.g_old_rec.cagr_api_id
185       ,p_cagr_api_param_id_o
186       => per_ret_shd.g_old_rec.cagr_api_param_id
187       ,p_cagr_entitlement_line_id_o
188       => per_ret_shd.g_old_rec.cagr_entitlement_line_id
189       ,p_freeze_flag_o
190       => per_ret_shd.g_old_rec.freeze_flag
191       ,p_value_o
192       => per_ret_shd.g_old_rec.value
193       ,p_units_of_measure_o
194       => per_ret_shd.g_old_rec.units_of_measure
195       ,p_start_date_o
196       => per_ret_shd.g_old_rec.start_date
197       ,p_end_date_o
198       => per_ret_shd.g_old_rec.end_date
199       ,p_parent_spine_id_o
200       => per_ret_shd.g_old_rec.parent_spine_id
201       ,p_formula_id_o
202       => per_ret_shd.g_old_rec.formula_id
203       ,p_oipl_id_o
204       => per_ret_shd.g_old_rec.oipl_id
205       ,p_step_id_o
206       => per_ret_shd.g_old_rec.step_id
207       ,p_grade_spine_id_o
208       => per_ret_shd.g_old_rec.grade_spine_id
209       ,p_column_type_o
210       => per_ret_shd.g_old_rec.column_type
211       ,p_column_size_o
212       => per_ret_shd.g_old_rec.column_size
213       ,p_eligy_prfl_id_o
214       => per_ret_shd.g_old_rec.eligy_prfl_id
215       ,p_object_version_number_o
216       => per_ret_shd.g_old_rec.object_version_number
217       ,p_cagr_entitlement_result_id_o
218       => per_ret_shd.g_old_rec.cagr_entitlement_result_id
219       ,p_business_group_id_o
220       => per_ret_shd.g_old_rec.business_group_id
221       ,p_flex_value_set_id_o
222       => per_ret_shd.g_old_rec.flex_value_set_id
223       );
224     --
225   exception
226     --
227     when hr_api.cannot_find_prog_unit then
228       --
229       hr_api.cannot_find_prog_unit_error
230         (p_module_name => 'PER_CAGR_RETAINED_RIGHTS'
231         ,p_hook_type   => 'AD');
232       --
233   end;
234 */
235   --
236   hr_utility.set_location(' Leaving:'||l_proc, 10);
237 End post_delete;
238 --
239 -- ----------------------------------------------------------------------------
240 -- |---------------------------------< del >----------------------------------|
241 -- ----------------------------------------------------------------------------
242 Procedure del
243   (p_rec              in per_ret_shd.g_rec_type
244   ) is
245 --
246   l_proc  varchar2(72) := g_package||'del';
247 --
248 Begin
249   hr_utility.set_location('Entering:'||l_proc, 5);
250   --
251   -- We must lock the row which we need to delete.
252   --
253   per_ret_shd.lck
254     (p_rec.cagr_retained_right_id
255     ,p_rec.object_version_number
256     );
257   --
258   -- Call the supporting delete validate operation
259   --
260   per_ret_bus.delete_validate(p_rec);
261   --
262   -- Call the supporting pre-delete operation
263   --
264   per_ret_del.pre_delete(p_rec);
265   --
266   -- Delete the row.
267   --
268   per_ret_del.delete_dml(p_rec);
269   --
270   -- Call the supporting post-delete operation
271   --
272   per_ret_del.post_delete(p_rec);
273   --
274 End del;
275 --
276 -- ----------------------------------------------------------------------------
277 -- |---------------------------------< del >----------------------------------|
278 -- ----------------------------------------------------------------------------
279 Procedure del
280   (p_cagr_retained_right_id              in     number
281   ,p_object_version_number                in     number
282   ) is
283 --
284   l_rec   per_ret_shd.g_rec_type;
285   l_proc  varchar2(72) := g_package||'del';
286 --
287 Begin
288   hr_utility.set_location('Entering:'||l_proc, 5);
289   --
290   -- As the delete procedure accepts a plsql record structure we do need to
291   -- convert the  arguments into the record structure.
292   -- We don't need to call the supplied conversion argument routine as we
293   -- only need a few attributes.
294   --
295   l_rec.cagr_retained_right_id := p_cagr_retained_right_id;
296   l_rec.object_version_number := p_object_version_number;
297   --
298   -- Having converted the arguments into the per_ret_rec
299   -- plsql record structure we must call the corresponding entity
300   -- business process
301   --
302   per_ret_del.del(l_rec);
303   --
304   hr_utility.set_location(' Leaving:'||l_proc, 10);
305 End del;
306 --
307 end per_ret_del;