1 Package Body ghr_rei_del as
2 /* $Header: ghreirhi.pkb 120.2.12010000.2 2008/09/02 07:19:59 vmididho ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ghr_rei_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). Not required changed by DARORA
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 -- Pre Conditions:
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. Not required, changed by DARORA
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. Not required, changed by DARORA
42 --
43 -- Developer Implementation Notes:
44 -- None.
45 --
46 -- Access Status:
47 -- Internal Table Handler Use Only.
48 --
49 -- {End Of Comments}
50 -- ----------------------------------------------------------------------------
51 Procedure delete_dml(p_rec in ghr_rei_shd.g_rec_type) is
52 --
53 l_proc varchar2(72) := g_package||'delete_dml';
54 --
55 Begin
56 hr_utility.set_location('Entering:'||l_proc, 5);
57 --
58 -- Delete the ghr_pa_request_extra_info row.
59 --
60 delete from ghr_pa_request_extra_info
61 where pa_request_extra_info_id = p_rec.pa_request_extra_info_id;
62 --
63 hr_utility.set_location(' Leaving:'||l_proc, 10);
64 --
65 Exception
66 When hr_api.child_integrity_violated then
67 -- Child integrity has been violated
68 ghr_rei_shd.constraint_error
69 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
70 When Others Then
71 Raise;
72 End delete_dml;
73 --
74 -- ----------------------------------------------------------------------------
75 -- |------------------------------< pre_delete >------------------------------|
76 -- ----------------------------------------------------------------------------
77 -- {Start Of Comments}
78 --
79 -- Description:
80 -- This private procedure contains any processing which is required before
81 -- the delete dml.
82 --
83 -- Pre Conditions:
84 -- This is an internal procedure which is called from the del procedure.
85 --
86 -- In Parameters:
87 -- A Pl/Sql record structre.
88 --
89 -- Post Success:
90 -- Processing continues.
91 --
92 -- Post Failure:
93 -- If an error has occurred, an error message and exception will be raised
94 -- but not handled.
95 --
96 -- Developer Implementation Notes:
97 -- Any pre-processing required before the delete dml is issued should be
98 -- coded within this procedure. It is important to note that any 3rd party
99 -- maintenance should be reviewed before placing in this procedure.
100 --
101 -- Access Status:
102 -- Internal Table Handler Use Only.
103 --
104 -- {End Of Comments}
105 -- ----------------------------------------------------------------------------
106 Procedure pre_delete(p_rec in ghr_rei_shd.g_rec_type) is
107 --
108 l_proc varchar2(72) := g_package||'pre_delete';
109 --
110 Begin
111 hr_utility.set_location('Entering:'||l_proc, 5);
112 --
113 hr_utility.set_location(' Leaving:'||l_proc, 10);
114 End pre_delete;
115 --
119 -- {Start Of Comments}
116 -- ----------------------------------------------------------------------------
117 -- |-----------------------------< post_delete >------------------------------|
118 -- ----------------------------------------------------------------------------
120 --
121 -- Description:
122 -- This private procedure contains any processing which is required after the
123 -- delete dml.
124 --
125 -- Pre Conditions:
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 post-processing required after 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 table Handler Use Only.
145 --
146 -- {End Of Comments}
147 -- ----------------------------------------------------------------------------
148 Procedure post_delete(p_rec in ghr_rei_shd.g_rec_type) is
149 --
150 l_proc varchar2(72) := g_package||'post_delete';
151 --
152 Begin
153 hr_utility.set_location('Entering:'||l_proc, 5);
154 --
155 -- This is a hook point and the user hook for post_delete is called here.
156 --
157 begin
158 ghr_rei_rkd.after_delete (
159 p_pa_request_extra_info_id_o => ghr_rei_shd.g_old_rec.pa_request_extra_info_id ,
160 p_pa_request_id_o => ghr_rei_shd.g_old_rec.pa_request_id ,
161 p_information_type_o => ghr_rei_shd.g_old_rec.information_type ,
162 p_rei_attribute_category_o => ghr_rei_shd.g_old_rec.rei_attribute_category ,
163 p_rei_attribute1_o => ghr_rei_shd.g_old_rec.rei_attribute1 ,
164 p_rei_attribute2_o => ghr_rei_shd.g_old_rec.rei_attribute2 ,
165 p_rei_attribute3_o => ghr_rei_shd.g_old_rec.rei_attribute3 ,
166 p_rei_attribute4_o => ghr_rei_shd.g_old_rec.rei_attribute4 ,
167 p_rei_attribute5_o => ghr_rei_shd.g_old_rec.rei_attribute5 ,
168 p_rei_attribute6_o => ghr_rei_shd.g_old_rec.rei_attribute6 ,
169 p_rei_attribute7_o => ghr_rei_shd.g_old_rec.rei_attribute7 ,
170 p_rei_attribute8_o => ghr_rei_shd.g_old_rec.rei_attribute8 ,
171 p_rei_attribute9_o => ghr_rei_shd.g_old_rec.rei_attribute9 ,
172 p_rei_attribute10_o => ghr_rei_shd.g_old_rec.rei_attribute10 ,
173 p_rei_attribute11_o => ghr_rei_shd.g_old_rec.rei_attribute11 ,
174 p_rei_attribute12_o => ghr_rei_shd.g_old_rec.rei_attribute12 ,
175 p_rei_attribute13_o => ghr_rei_shd.g_old_rec.rei_attribute13 ,
176 p_rei_attribute14_o => ghr_rei_shd.g_old_rec.rei_attribute14 ,
177 p_rei_attribute15_o => ghr_rei_shd.g_old_rec.rei_attribute15 ,
178 p_rei_attribute16_o => ghr_rei_shd.g_old_rec.rei_attribute16 ,
179 p_rei_attribute17_o => ghr_rei_shd.g_old_rec.rei_attribute17 ,
180 p_rei_attribute18_o => ghr_rei_shd.g_old_rec.rei_attribute18 ,
181 p_rei_attribute19_o => ghr_rei_shd.g_old_rec.rei_attribute19 ,
182 p_rei_attribute20_o => ghr_rei_shd.g_old_rec.rei_attribute20 ,
183 p_rei_information_category_o => ghr_rei_shd.g_old_rec.rei_information_category ,
184 p_rei_information1_o => ghr_rei_shd.g_old_rec.rei_information1 ,
185 p_rei_information2_o => ghr_rei_shd.g_old_rec.rei_information2 ,
186 p_rei_information3_o => ghr_rei_shd.g_old_rec.rei_information3 ,
187 p_rei_information4_o => ghr_rei_shd.g_old_rec.rei_information4 ,
188 p_rei_information5_o => ghr_rei_shd.g_old_rec.rei_information5 ,
189 p_rei_information6_o => ghr_rei_shd.g_old_rec.rei_information6 ,
190 p_rei_information7_o => ghr_rei_shd.g_old_rec.rei_information7 ,
191 p_rei_information8_o => ghr_rei_shd.g_old_rec.rei_information8 ,
192 p_rei_information9_o => ghr_rei_shd.g_old_rec.rei_information9 ,
193 p_rei_information10_o => ghr_rei_shd.g_old_rec.rei_information10 ,
194 p_rei_information11_o => ghr_rei_shd.g_old_rec.rei_information11 ,
195 p_rei_information12_o => ghr_rei_shd.g_old_rec.rei_information12 ,
196 p_rei_information13_o => ghr_rei_shd.g_old_rec.rei_information13 ,
197 p_rei_information14_o => ghr_rei_shd.g_old_rec.rei_information14 ,
198 p_rei_information15_o => ghr_rei_shd.g_old_rec.rei_information15 ,
199 p_rei_information16_o => ghr_rei_shd.g_old_rec.rei_information16 ,
200 p_rei_information17_o => ghr_rei_shd.g_old_rec.rei_information17 ,
201 p_rei_information18_o => ghr_rei_shd.g_old_rec.rei_information18 ,
202 p_rei_information19_o => ghr_rei_shd.g_old_rec.rei_information19 ,
203 p_rei_information20_o => ghr_rei_shd.g_old_rec.rei_information20 ,
204 p_rei_information21_o => ghr_rei_shd.g_old_rec.rei_information21 ,
205 p_rei_information22_o => ghr_rei_shd.g_old_rec.rei_information22 ,
206 p_rei_information28_o => ghr_rei_shd.g_old_rec.rei_information28 ,
207 p_rei_information29_o => ghr_rei_shd.g_old_rec.rei_information29 ,
208 p_rei_information23_o => ghr_rei_shd.g_old_rec.rei_information23 ,
209 p_rei_information24_o => ghr_rei_shd.g_old_rec.rei_information24 ,
210 p_rei_information25_o => ghr_rei_shd.g_old_rec.rei_information25 ,
211 p_rei_information26_o => ghr_rei_shd.g_old_rec.rei_information26 ,
212 p_rei_information27_o => ghr_rei_shd.g_old_rec.rei_information27 ,
213 p_rei_information30_o => ghr_rei_shd.g_old_rec.rei_information30 ,
214 p_request_id_o => ghr_rei_shd.g_old_rec.request_id ,
215 p_program_application_id_o => ghr_rei_shd.g_old_rec.program_application_id ,
216 p_program_id_o => ghr_rei_shd.g_old_rec.program_id ,
217 p_program_update_date_o => ghr_rei_shd.g_old_rec.program_update_date
218 );
219 exception
220 when hr_api.cannot_find_prog_unit then
221 hr_api.cannot_find_prog_unit_error
222 ( p_module_name => 'GHR_PA_REQUEST_EXTRA_INFO'
223 ,p_hook_type => 'AD'
224 );
225 end;
226 -- End of API User Hook for post_delete.
227 hr_utility.set_location(' Leaving:'||l_proc, 10);
228 End post_delete;
229 --
230 -- ----------------------------------------------------------------------------
231 -- |---------------------------------< del >----------------------------------|
232 -- ----------------------------------------------------------------------------
233 Procedure del
234 (
235 p_rec in ghr_rei_shd.g_rec_type,
236 p_validate in boolean default false
237 ) is
238 --
239 l_proc varchar2(72) := g_package||'del';
240 --
241 Begin
242 hr_utility.set_location('Entering:'||l_proc, 5);
243 --
244 -- Determine if the business process is to be validated.
245 --
246 If p_validate then
247 --
248 -- Issue the savepoint.
249 --
250 SAVEPOINT del_ghr_rei;
251 End If;
252 --
253 -- We must lock the row which we need to delete.
254 --
255 ghr_rei_shd.lck
256 (
257 p_rec.pa_request_extra_info_id,
258 p_rec.object_version_number
259 );
260 --
261 -- Call the supporting delete validate operation
262 --
263 ghr_rei_bus.delete_validate(p_rec);
264 --
265 -- Call the supporting pre-delete operation
266 --
267 pre_delete(p_rec);
268 --
269 -- Delete the row.
270 --
271 delete_dml(p_rec);
272 --
273 -- Call the supporting post-delete operation
274 --
275 post_delete(p_rec);
276 --
277 -- If we are validating then raise the Validate_Enabled exception
278 --
279 If p_validate then
280 Raise HR_Api.Validate_Enabled;
281 End If;
282 --
283 hr_utility.set_location(' Leaving:'||l_proc, 10);
284 Exception
285 When HR_Api.Validate_Enabled Then
286 --
287 -- As the Validate_Enabled exception has been raised
288 -- we must rollback to the savepoint
289 --
290 ROLLBACK TO del_ghr_rei;
291 End del;
292 --
293 -- ----------------------------------------------------------------------------
294 -- |---------------------------------< del >----------------------------------|
295 -- ----------------------------------------------------------------------------
296 Procedure del
297 (
298 p_pa_request_extra_info_id in number,
299 p_object_version_number in number,
300 p_validate in boolean default false
301 ) is
302 --
303 l_rec ghr_rei_shd.g_rec_type;
304 l_proc varchar2(72) := g_package||'del';
305 --
306 Begin
307 hr_utility.set_location('Entering:'||l_proc, 5);
308 --
309 -- As the delete procedure accepts a plsql record structure we do need to
310 -- convert the arguments into the record structure.
311 -- We don't need to call the supplied conversion argument routine as we
312 -- only need a few attributes.
313 --
314 l_rec.pa_request_extra_info_id:= p_pa_request_extra_info_id;
315 l_rec.object_version_number := p_object_version_number;
316 --
317 -- Having converted the arguments into the ghr_rei_rec
318 -- plsql record structure we must call the corresponding entity
319 -- business process
320 --
321 del(l_rec, p_validate);
322 --
323 hr_utility.set_location(' Leaving:'||l_proc, 10);
324 End del;
325 --
326 end ghr_rei_del;