DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_EIV_DEL

Source


1 Package Body ben_eiv_del as
2 /* $Header: beeivrhi.pkb 115.4 2002/12/22 20:25:28 pabodla noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  ben_eiv_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 ben_eiv_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   ben_eiv_shd.g_api_dml := true;  -- Set the api dml status
61   --
62   -- Delete the ben_extra_input_values row.
63   --
64   delete from ben_extra_input_values
65   where extra_input_value_id = p_rec.extra_input_value_id;
66   --
67   ben_eiv_shd.g_api_dml := false;   -- Unset the api dml status
68   --
69   hr_utility.set_location(' Leaving:'||l_proc, 10);
70 --
71 Exception
72   When hr_api.child_integrity_violated then
73     -- Child integrity has been violated
74     ben_eiv_shd.g_api_dml := false;   -- Unset the api dml status
75     ben_eiv_shd.constraint_error
76       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
77   When Others Then
78     ben_eiv_shd.g_api_dml := false;   -- Unset the api dml status
79     Raise;
80 End delete_dml;
81 --
82 -- ----------------------------------------------------------------------------
83 -- |------------------------------< pre_delete >------------------------------|
84 -- ----------------------------------------------------------------------------
85 -- {Start Of Comments}
86 --
87 -- Description:
88 --   This private procedure contains any processing which is required before
89 --   the delete dml.
90 --
91 -- Prerequisites:
92 --   This is an internal procedure which is called from the del procedure.
93 --
94 -- In Parameters:
95 --   A Pl/Sql record structre.
96 --
97 -- Post Success:
98 --   Processing continues.
99 --
100 -- Post Failure:
101 --   If an error has occurred, an error message and exception will be raised
102 --   but not handled.
103 --
104 -- Developer Implementation Notes:
105 --   Any pre-processing required before the delete dml is issued should be
106 --   coded within this procedure. It is important to note that any 3rd party
107 --   maintenance should be reviewed before placing in this procedure.
108 --
109 -- Access Status:
110 --   Internal Row Handler Use Only.
111 --
112 -- {End Of Comments}
113 -- ----------------------------------------------------------------------------
114 Procedure pre_delete(p_effective_date in date
115                     ,p_rec in ben_eiv_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_effective_date in date
158                      ,p_rec in ben_eiv_shd.g_rec_type) is
159 --
160   l_proc  varchar2(72) := g_package||'post_delete';
161 --
162 Begin
163   hr_utility.set_location('Entering:'||l_proc, 5);
164   begin
165     --
166     ben_eiv_rkd.after_delete
167       (p_extra_input_value_id
168       => p_rec.extra_input_value_id
169       ,p_acty_base_rt_id_o
170       => ben_eiv_shd.g_old_rec.acty_base_rt_id
171       ,p_input_value_id_o
172       => ben_eiv_shd.g_old_rec.input_value_id
173       ,p_input_text_o
174       => ben_eiv_shd.g_old_rec.input_text
175       ,p_upd_when_ele_ended_cd_o
176       => ben_eiv_shd.g_old_rec.upd_when_ele_ended_cd
177       ,p_return_var_name_o
178       => ben_eiv_shd.g_old_rec.return_var_name
179       ,p_business_group_id_o
180       => ben_eiv_shd.g_old_rec.business_group_id
181       ,p_eiv_attribute_category_o
182       => ben_eiv_shd.g_old_rec.eiv_attribute_category
183       ,p_eiv_attribute1_o
184       => ben_eiv_shd.g_old_rec.eiv_attribute1
185       ,p_eiv_attribute2_o
186       => ben_eiv_shd.g_old_rec.eiv_attribute2
187       ,p_eiv_attribute3_o
188       => ben_eiv_shd.g_old_rec.eiv_attribute3
189       ,p_eiv_attribute4_o
190       => ben_eiv_shd.g_old_rec.eiv_attribute4
191       ,p_eiv_attribute5_o
192       => ben_eiv_shd.g_old_rec.eiv_attribute5
193       ,p_eiv_attribute6_o
194       => ben_eiv_shd.g_old_rec.eiv_attribute6
195       ,p_eiv_attribute7_o
196       => ben_eiv_shd.g_old_rec.eiv_attribute7
197       ,p_eiv_attribute8_o
198       => ben_eiv_shd.g_old_rec.eiv_attribute8
199       ,p_eiv_attribute9_o
200       => ben_eiv_shd.g_old_rec.eiv_attribute9
201       ,p_eiv_attribute10_o
202       => ben_eiv_shd.g_old_rec.eiv_attribute10
203       ,p_eiv_attribute11_o
204       => ben_eiv_shd.g_old_rec.eiv_attribute11
205       ,p_eiv_attribute12_o
206       => ben_eiv_shd.g_old_rec.eiv_attribute12
207       ,p_eiv_attribute13_o
208       => ben_eiv_shd.g_old_rec.eiv_attribute13
209       ,p_eiv_attribute14_o
210       => ben_eiv_shd.g_old_rec.eiv_attribute14
211       ,p_eiv_attribute15_o
212       => ben_eiv_shd.g_old_rec.eiv_attribute15
213       ,p_eiv_attribute16_o
214       => ben_eiv_shd.g_old_rec.eiv_attribute16
215       ,p_eiv_attribute17_o
216       => ben_eiv_shd.g_old_rec.eiv_attribute17
217       ,p_eiv_attribute18_o
218       => ben_eiv_shd.g_old_rec.eiv_attribute18
219       ,p_eiv_attribute19_o
220       => ben_eiv_shd.g_old_rec.eiv_attribute19
221       ,p_eiv_attribute20_o
222       => ben_eiv_shd.g_old_rec.eiv_attribute20
223       ,p_eiv_attribute21_o
224       => ben_eiv_shd.g_old_rec.eiv_attribute21
225       ,p_eiv_attribute22_o
226       => ben_eiv_shd.g_old_rec.eiv_attribute22
227       ,p_eiv_attribute23_o
228       => ben_eiv_shd.g_old_rec.eiv_attribute23
229       ,p_eiv_attribute24_o
230       => ben_eiv_shd.g_old_rec.eiv_attribute24
231       ,p_eiv_attribute25_o
232       => ben_eiv_shd.g_old_rec.eiv_attribute25
233       ,p_eiv_attribute26_o
234       => ben_eiv_shd.g_old_rec.eiv_attribute26
235       ,p_eiv_attribute27_o
236       => ben_eiv_shd.g_old_rec.eiv_attribute27
237       ,p_eiv_attribute28_o
238       => ben_eiv_shd.g_old_rec.eiv_attribute28
239       ,p_eiv_attribute29_o
240       => ben_eiv_shd.g_old_rec.eiv_attribute29
241       ,p_eiv_attribute30_o
242       => ben_eiv_shd.g_old_rec.eiv_attribute30
243       ,p_object_version_number_o
244       => ben_eiv_shd.g_old_rec.object_version_number
245       );
246     --
247   exception
248     --
249     when hr_api.cannot_find_prog_unit then
250       --
251       hr_api.cannot_find_prog_unit_error
252         (p_module_name => 'BEN_EXTRA_INPUT_VALUES'
253         ,p_hook_type   => 'AD');
254       --
255   end;
256   --
257   hr_utility.set_location(' Leaving:'||l_proc, 10);
258 End post_delete;
259 --
260 -- ----------------------------------------------------------------------------
261 -- |---------------------------------< del >----------------------------------|
262 -- ----------------------------------------------------------------------------
263 Procedure del
264   (p_effective_date   in date
265   ,p_rec              in ben_eiv_shd.g_rec_type
266   ) is
267 --
268   l_proc  varchar2(72) := g_package||'del';
269 --
270 Begin
271   hr_utility.set_location('Entering:'||l_proc, 5);
272   --
273   -- We must lock the row which we need to delete.
274   --
275   ben_eiv_shd.lck
276     (p_rec.extra_input_value_id
277     ,p_rec.object_version_number
278     );
279   --
280   -- Call the supporting delete validate operation
281   --
282   ben_eiv_bus.delete_validate(p_rec,p_effective_date);
283   --
284   -- Call the supporting pre-delete operation
285   --
286   ben_eiv_del.pre_delete(p_effective_date,p_rec);
287   --
288   -- Delete the row.
289   --
290   ben_eiv_del.delete_dml(p_rec);
291   --
292   -- Call the supporting post-delete operation
293   --
294   ben_eiv_del.post_delete(p_effective_date,p_rec);
295   --
296 End del;
297 --
298 -- ----------------------------------------------------------------------------
299 -- |---------------------------------< del >----------------------------------|
300 -- ----------------------------------------------------------------------------
301 Procedure del
302   (p_effective_date                       in     date
303   ,p_extra_input_value_id                 in     number
304   ,p_object_version_number                in     number
305   ) is
306 --
307   l_rec   ben_eiv_shd.g_rec_type;
308   l_proc  varchar2(72) := g_package||'del';
309 --
310 Begin
311   hr_utility.set_location('Entering:'||l_proc, 5);
312   --
313   -- As the delete procedure accepts a plsql record structure we do need to
314   -- convert the  arguments into the record structure.
315   -- We don't need to call the supplied conversion argument routine as we
316   -- only need a few attributes.
317   --
318   l_rec.extra_input_value_id := p_extra_input_value_id;
319   l_rec.object_version_number := p_object_version_number;
320   --
321   -- Having converted the arguments into the ben_eiv_rec
322   -- plsql record structure we must call the corresponding entity
323   -- business process
324   --
325   ben_eiv_del.del(p_effective_date
326                  ,l_rec);
327   --
328   hr_utility.set_location(' Leaving:'||l_proc, 10);
329 End del;
330 --
331 end ben_eiv_del;