1 Package Body ben_eli_del as
2 /* $Header: beelirhi.pkb 115.1 2004/04/14 02:40:36 hmani noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_eli_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 delete the specified row from the schema using the primary key in
19 -- the predicates.
20 -- 2) To trap any constraint violations that may have occurred.
21 -- 3) To raise any other errors.
22 --
23 -- Pre Conditions:
24 -- This is an internal private procedure which must be called from the del
25 -- procedure.
26 --
27 -- In Parameters:
28 -- A elp/Sql record structre.
29 --
30 -- Post Success:
31 -- The specified row will be delete from the schema.
32 --
33 -- Post Failure:
34 -- If a child integrity constraint violation is raised the
35 -- constraint_error procedure will be called.
36 --
37 -- Developer Implementation Notes:
38 -- None.
39 --
40 -- Access Status:
41 -- Internal Table Handelp Use Only.
42 --
43 -- {End Of Comments}
44 -- ----------------------------------------------------------------------------
45 Procedure delete_dml(p_rec in ben_eli_shd.g_rec_type) is
46 --
47 l_proc varchar2(72) := g_package||'delete_dml';
48 --
49 Begin
50 hr_utility.set_location('Entering:'||l_proc, 5);
51 --
52 --
53 -- Delete the ben_elp_extra_info row.
54 --
55 delete from ben_elp_extra_info
56 where elp_extra_info_id = p_rec.elp_extra_info_id;
57 --
58 --
59 hr_utility.set_location(' Leaving:'||l_proc, 10);
60 --
61 Exception
62 When hr_api.child_integrity_violated then
63 -- Child integrity has been violated
64 ben_eli_shd.constraint_error
65 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
66 When Others Then
67 Raise;
68 End delete_dml;
69 --
70 -- ----------------------------------------------------------------------------
71 -- |------------------------------< pre_delete >------------------------------|
72 -- ----------------------------------------------------------------------------
73 -- {Start Of Comments}
74 --
75 -- Description:
76 -- This private procedure contains any processing which is required before
77 -- the delete dml.
78 --
79 -- Pre Conditions:
80 -- This is an internal procedure which is called from the del procedure.
81 --
82 -- In Parameters:
83 -- A elp/Sql record structre.
84 --
85 -- Post Success:
86 -- Processing continues.
87 --
88 -- Post Failure:
89 -- If an error has occurred, an error message and exception will be raised
90 -- but not handled.
91 --
92 -- Developer Implementation Notes:
93 -- Any pre-processing required before the delete dml is issued should be
94 -- coded within this procedure. It is important to note that any 3rd party
95 -- maintenance should be reviewed before elpacing in this procedure.
96 --
97 -- Access Status:
98 -- Internal Table Handelp Use Only.
99 --
100 -- {End Of Comments}
101 -- ----------------------------------------------------------------------------
102 Procedure pre_delete(p_rec in ben_eli_shd.g_rec_type) is
103 --
104 l_proc varchar2(72) := g_package||'pre_delete';
105 --
106 Begin
107 hr_utility.set_location('Entering:'||l_proc, 5);
108 --
109 hr_utility.set_location(' Leaving:'||l_proc, 10);
110 End pre_delete;
111 --
112 -- ----------------------------------------------------------------------------
113 -- |-----------------------------< post_delete >------------------------------|
114 -- ----------------------------------------------------------------------------
115 -- {Start Of Comments}
116 --
117 -- Description:
118 -- This private procedure contains any processing which is required after the
119 -- delete dml.
120 --
121 -- Pre Conditions:
122 -- This is an internal procedure which is called from the del procedure.
123 --
124 -- In Parameters:
125 -- A elp/Sql record structre.
126 --
127 -- Post Success:
128 -- Processing continues.
129 --
130 -- Post Failure:
131 -- If an error has occurred, an error message and exception will be raised
132 -- but not handled.
133 --
134 -- Developer Implementation Notes:
135 -- Any post-processing required after the delete dml is issued should be
136 -- coded within this procedure. It is important to note that any 3rd party
137 -- maintenance should be reviewed before elpacing in this procedure.
138 --
139 -- Access Status:
140 -- Internal table Handelp Use Only.
141 --
142 -- {End Of Comments}
143 -- ----------------------------------------------------------------------------
144 Procedure post_delete(p_rec in ben_eli_shd.g_rec_type) is
145 --
146 l_proc varchar2(72) := g_package||'post_delete';
147 --
148 Begin
149 hr_utility.set_location('Entering:'||l_proc, 5);
150 --
151 -- This is a hook point and the user hook for post_delete is called here.
152 --
153 begin
154 ben_eli_rkd.after_delete (
155 p_elp_extra_info_id_o => ben_eli_shd.g_old_rec.elp_extra_info_id ,
156 p_information_type_o => ben_eli_shd.g_old_rec.information_type ,
157 p_eligy_prfl_id_o => ben_eli_shd.g_old_rec.eligy_prfl_id ,
158 p_request_id_o => ben_eli_shd.g_old_rec.request_id ,
159 p_program_application_id_o => ben_eli_shd.g_old_rec.program_application_id ,
160 p_program_id_o => ben_eli_shd.g_old_rec.program_id ,
161 p_program_update_date_o => ben_eli_shd.g_old_rec.program_update_date ,
162 p_eli_attribute_category_o => ben_eli_shd.g_old_rec.eli_attribute_category ,
163 p_eli_attribute1_o => ben_eli_shd.g_old_rec.eli_attribute1 ,
164 p_eli_attribute2_o => ben_eli_shd.g_old_rec.eli_attribute2 ,
165 p_eli_attribute3_o => ben_eli_shd.g_old_rec.eli_attribute3 ,
166 p_eli_attribute4_o => ben_eli_shd.g_old_rec.eli_attribute4 ,
167 p_eli_attribute5_o => ben_eli_shd.g_old_rec.eli_attribute5 ,
168 p_eli_attribute6_o => ben_eli_shd.g_old_rec.eli_attribute6 ,
169 p_eli_attribute7_o => ben_eli_shd.g_old_rec.eli_attribute7 ,
170 p_eli_attribute8_o => ben_eli_shd.g_old_rec.eli_attribute8 ,
171 p_eli_attribute9_o => ben_eli_shd.g_old_rec.eli_attribute9 ,
172 p_eli_attribute10_o => ben_eli_shd.g_old_rec.eli_attribute10 ,
173 p_eli_attribute11_o => ben_eli_shd.g_old_rec.eli_attribute11 ,
174 p_eli_attribute12_o => ben_eli_shd.g_old_rec.eli_attribute12 ,
175 p_eli_attribute13_o => ben_eli_shd.g_old_rec.eli_attribute13 ,
176 p_eli_attribute14_o => ben_eli_shd.g_old_rec.eli_attribute14 ,
177 p_eli_attribute15_o => ben_eli_shd.g_old_rec.eli_attribute15 ,
178 p_eli_attribute16_o => ben_eli_shd.g_old_rec.eli_attribute16 ,
179 p_eli_attribute17_o => ben_eli_shd.g_old_rec.eli_attribute17 ,
180 p_eli_attribute18_o => ben_eli_shd.g_old_rec.eli_attribute18 ,
181 p_eli_attribute19_o => ben_eli_shd.g_old_rec.eli_attribute19 ,
182 p_eli_attribute20_o => ben_eli_shd.g_old_rec.eli_attribute20 ,
183 p_eli_information_category_o => ben_eli_shd.g_old_rec.eli_information_category ,
184 p_eli_information1_o => ben_eli_shd.g_old_rec.eli_information1 ,
185 p_eli_information2_o => ben_eli_shd.g_old_rec.eli_information2 ,
186 p_eli_information3_o => ben_eli_shd.g_old_rec.eli_information3 ,
187 p_eli_information4_o => ben_eli_shd.g_old_rec.eli_information4 ,
188 p_eli_information5_o => ben_eli_shd.g_old_rec.eli_information5 ,
189 p_eli_information6_o => ben_eli_shd.g_old_rec.eli_information6 ,
190 p_eli_information7_o => ben_eli_shd.g_old_rec.eli_information7 ,
191 p_eli_information8_o => ben_eli_shd.g_old_rec.eli_information8 ,
192 p_eli_information9_o => ben_eli_shd.g_old_rec.eli_information9 ,
193 p_eli_information10_o => ben_eli_shd.g_old_rec.eli_information10 ,
194 p_eli_information11_o => ben_eli_shd.g_old_rec.eli_information11 ,
195 p_eli_information12_o => ben_eli_shd.g_old_rec.eli_information12 ,
196 p_eli_information13_o => ben_eli_shd.g_old_rec.eli_information13 ,
197 p_eli_information14_o => ben_eli_shd.g_old_rec.eli_information14 ,
198 p_eli_information15_o => ben_eli_shd.g_old_rec.eli_information15 ,
199 p_eli_information16_o => ben_eli_shd.g_old_rec.eli_information16 ,
200 p_eli_information17_o => ben_eli_shd.g_old_rec.eli_information17 ,
201 p_eli_information18_o => ben_eli_shd.g_old_rec.eli_information18 ,
202 p_eli_information19_o => ben_eli_shd.g_old_rec.eli_information19 ,
203 p_eli_information20_o => ben_eli_shd.g_old_rec.eli_information20 ,
204 p_eli_information21_o => ben_eli_shd.g_old_rec.eli_information21 ,
205 p_eli_information22_o => ben_eli_shd.g_old_rec.eli_information22 ,
206 p_eli_information23_o => ben_eli_shd.g_old_rec.eli_information23 ,
207 p_eli_information24_o => ben_eli_shd.g_old_rec.eli_information24 ,
208 p_eli_information25_o => ben_eli_shd.g_old_rec.eli_information25 ,
209 p_eli_information26_o => ben_eli_shd.g_old_rec.eli_information26 ,
210 p_eli_information27_o => ben_eli_shd.g_old_rec.eli_information27 ,
211 p_eli_information28_o => ben_eli_shd.g_old_rec.eli_information28 ,
212 p_eli_information29_o => ben_eli_shd.g_old_rec.eli_information29 ,
213 p_eli_information30_o => ben_eli_shd.g_old_rec.eli_information30
214 );
215 exception
216 when hr_api.cannot_find_prog_unit then
217 hr_api.cannot_find_prog_unit_error
218 ( p_module_name => 'BEN_ELP_EXTRA_INFO'
219 ,p_hook_type => 'AD'
220 );
221 end;
222 -- End of API User Hook for post_delete.
223 hr_utility.set_location(' Leaving:'||l_proc, 10);
224 End post_delete;
225 --
226 -- ----------------------------------------------------------------------------
227 -- |---------------------------------< del >----------------------------------|
228 -- ----------------------------------------------------------------------------
229 Procedure del
230 (
231 p_rec in ben_eli_shd.g_rec_type,
232 p_validate in boolean default false
233 ) is
234 --
235 l_proc varchar2(72) := g_package||'del';
236 --
237 Begin
238 hr_utility.set_location('Entering:'||l_proc, 5);
239 --
240 -- Determine if the business process is to be validated.
241 --
242 If p_validate then
243 --
244 -- Issue the savepoint.
245 --
246 SAVEPOINT del_ben_eli;
247 End If;
248 --
249 -- We must lock the row which we need to delete.
250 --
251 ben_eli_shd.lck
252 (
253 p_rec.elp_extra_info_id,
254 p_rec.object_version_number
255 );
256 --
257 -- Call the supporting delete validate operation
258 --
259 ben_eli_bus.delete_validate(p_rec);
260 --
261 -- Call the supporting pre-delete operation
262 --
263 pre_delete(p_rec);
264 --
265 -- Delete the row.
266 --
267 delete_dml(p_rec);
268 --
269 -- Call the supporting post-delete operation
270 --
271 post_delete(p_rec);
272 --
273 -- If we are validating then raise the Validate_Enabled exception
274 --
275 If p_validate then
276 Raise HR_Api.Validate_Enabled;
277 End If;
278 --
279 hr_utility.set_location(' Leaving:'||l_proc, 10);
280 Exception
281 When HR_Api.Validate_Enabled Then
282 --
283 -- As the Validate_Enabled exception has been raised
284 -- we must rollback to the savepoint
285 --
286 ROLLBACK TO del_ben_eli;
287 End del;
288 --
289 -- ----------------------------------------------------------------------------
290 -- |---------------------------------< del >----------------------------------|
291 -- ----------------------------------------------------------------------------
292 Procedure del
293 (
294 p_elp_extra_info_id in number,
295 p_object_version_number in number,
296 p_validate in boolean default false
297 ) is
298 --
299 l_rec ben_eli_shd.g_rec_type;
300 l_proc varchar2(72) := g_package||'del';
301 --
302 Begin
303 hr_utility.set_location('Entering:'||l_proc, 5);
304 --
305 -- As the delete procedure accepts a elpsql record structure we do need to
306 -- convert the arguments into the record structure.
307 -- We don't need to call the supplied conversion argument routine as we
308 -- only need a few attributes.
309 --
310 l_rec.elp_extra_info_id:= p_elp_extra_info_id;
311 l_rec.object_version_number := p_object_version_number;
312 --
313 -- Having converted the arguments into the ben_eli_rec
314 -- elpsql record structure we must call the corresponding entity
315 -- business process
316 --
317 del(l_rec, p_validate);
318 --
319 hr_utility.set_location(' Leaving:'||l_proc, 10);
320 End del;
321 --
322 end ben_eli_del;