1 Package Body hr_wnp_del as
2 /* $Header: hrwnprhi.pkb 120.1 2011/04/28 10:20:23 sidsaxen ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' hr_wnp_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_wnp_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 --
62 -- Delete the hr_window_properties_b row.
63 --
64
65 --
66 -- Added the following code as a part of Zero Downtime Patching Project.
67 -- Code Starts Here.
68 --
69
70 BEGIN
71 PER_RIC_PKG.chk_integrity (
72 p_entity_name => 'HR_WINDOW_PROPERTIES_B',
73 p_ref_entity => 'HR_WINDOW_PROPERTIES_TL',
74 p_ref_column_name => 'WINDOW_PROPERTY_ID',
75 p_ref_col_value_number => p_rec.window_property_id,
76 p_ref_col_value_varchar => NULL,
77 p_ref_col_value_date => NULL,
78 p_ref_type => 'DEL');
79
80 END;
81 --
82 -- Code Ends Here.
83 --
84
85 delete from hr_window_properties_b
86 where window_property_id = p_rec.window_property_id;
87 --
88 --
89 --
90 hr_utility.set_location(' Leaving:'||l_proc, 10);
91 --
92 Exception
93 When hr_api.child_integrity_violated then
94 -- Child integrity has been violated
95 --
96 hr_wnp_shd.constraint_error
97 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
98 When Others Then
99 --
100 Raise;
101 End delete_dml;
102 --
103 -- ----------------------------------------------------------------------------
104 -- |------------------------------< pre_delete >------------------------------|
105 -- ----------------------------------------------------------------------------
106 -- {Start Of Comments}
107 --
108 -- Description:
109 -- This private procedure contains any processing which is required before
110 -- the delete dml.
111 --
112 -- Prerequisites:
113 -- This is an internal procedure which is called from the del procedure.
114 --
115 -- In Parameters:
116 -- A Pl/Sql record structre.
117 --
118 -- Post Success:
119 -- Processing continues.
120 --
121 -- Post Failure:
122 -- If an error has occurred, an error message and exception will be raised
123 -- but not handled.
124 --
125 -- Developer Implementation Notes:
126 -- Any pre-processing required before the delete dml is issued should be
127 -- coded within this procedure. It is important to note that any 3rd party
128 -- maintenance should be reviewed before placing in this procedure.
129 --
130 -- Access Status:
131 -- Internal Row Handler Use Only.
132 --
133 -- {End Of Comments}
134 -- ----------------------------------------------------------------------------
135 Procedure pre_delete(p_rec in hr_wnp_shd.g_rec_type) is
136 --
137 l_proc varchar2(72) := g_package||'pre_delete';
138 --
139 Begin
140 hr_utility.set_location('Entering:'||l_proc, 5);
141 --
142 hr_utility.set_location(' Leaving:'||l_proc, 10);
143 End pre_delete;
144 --
145 -- ----------------------------------------------------------------------------
146 -- |-----------------------------< post_delete >------------------------------|
147 -- ----------------------------------------------------------------------------
148 -- {Start Of Comments}
149 --
150 -- Description:
151 -- This private procedure contains any processing which is required after the
152 -- delete dml.
153 --
154 -- Prerequistes:
155 -- This is an internal procedure which is called from the del procedure.
156 --
157 -- In Parameters:
158 -- A Pl/Sql record structure.
159 --
160 -- Post Success:
161 -- Processing continues.
162 --
163 -- Post Failure:
164 -- If an error has occurred, an error message and exception will be raised
165 -- but not handled.
166 --
167 -- Developer Implementation Notes:
168 -- Any post-processing required after the delete dml is issued should be
169 -- coded within this procedure. It is important to note that any 3rd party
170 -- maintenance should be reviewed before placing in this procedure.
171 --
172 -- Access Status:
173 -- Internal Row Handler Use Only.
174 --
175 -- {End Of Comments}
176 -- -----------------------------------------------------------------------------
177 Procedure post_delete(p_rec in hr_wnp_shd.g_rec_type) is
178 --
179 l_proc varchar2(72) := g_package||'post_delete';
180 --
181 Begin
182 hr_utility.set_location('Entering:'||l_proc, 5);
183 begin
184 --
185 hr_wnp_rkd.after_delete
186 (p_window_property_id
187 => p_rec.window_property_id
188 ,p_form_window_id_o
189 => hr_wnp_shd.g_old_rec.form_window_id
190 ,p_template_window_id_o
191 => hr_wnp_shd.g_old_rec.template_window_id
192 ,p_height_o
193 => hr_wnp_shd.g_old_rec.height
194 ,p_width_o
195 => hr_wnp_shd.g_old_rec.width
196 ,p_x_position_o
197 => hr_wnp_shd.g_old_rec.x_position
198 ,p_y_position_o
199 => hr_wnp_shd.g_old_rec.y_position
200 ,p_information_category_o
201 => hr_wnp_shd.g_old_rec.information_category
202 ,p_information1_o
203 => hr_wnp_shd.g_old_rec.information1
204 ,p_information2_o
205 => hr_wnp_shd.g_old_rec.information2
206 ,p_information3_o
207 => hr_wnp_shd.g_old_rec.information3
208 ,p_information4_o
209 => hr_wnp_shd.g_old_rec.information4
210 ,p_information5_o
211 => hr_wnp_shd.g_old_rec.information5
212 ,p_information6_o
213 => hr_wnp_shd.g_old_rec.information6
214 ,p_information7_o
215 => hr_wnp_shd.g_old_rec.information7
216 ,p_information8_o
217 => hr_wnp_shd.g_old_rec.information8
218 ,p_information9_o
219 => hr_wnp_shd.g_old_rec.information9
220 ,p_information10_o
221 => hr_wnp_shd.g_old_rec.information10
222 ,p_information11_o
223 => hr_wnp_shd.g_old_rec.information11
224 ,p_information12_o
225 => hr_wnp_shd.g_old_rec.information12
226 ,p_information13_o
227 => hr_wnp_shd.g_old_rec.information13
228 ,p_information14_o
229 => hr_wnp_shd.g_old_rec.information14
230 ,p_information15_o
231 => hr_wnp_shd.g_old_rec.information15
232 ,p_information16_o
233 => hr_wnp_shd.g_old_rec.information16
234 ,p_information17_o
235 => hr_wnp_shd.g_old_rec.information17
236 ,p_information18_o
237 => hr_wnp_shd.g_old_rec.information18
238 ,p_information19_o
239 => hr_wnp_shd.g_old_rec.information19
240 ,p_information20_o
241 => hr_wnp_shd.g_old_rec.information20
242 ,p_information21_o
243 => hr_wnp_shd.g_old_rec.information21
244 ,p_information22_o
245 => hr_wnp_shd.g_old_rec.information22
246 ,p_information23_o
247 => hr_wnp_shd.g_old_rec.information23
248 ,p_information24_o
249 => hr_wnp_shd.g_old_rec.information24
250 ,p_information25_o
251 => hr_wnp_shd.g_old_rec.information25
252 ,p_information26_o
253 => hr_wnp_shd.g_old_rec.information26
254 ,p_information27_o
255 => hr_wnp_shd.g_old_rec.information27
256 ,p_information28_o
257 => hr_wnp_shd.g_old_rec.information28
258 ,p_information29_o
259 => hr_wnp_shd.g_old_rec.information29
260 ,p_information30_o
261 => hr_wnp_shd.g_old_rec.information30
262 );
263 --
264 exception
265 --
266 when hr_api.cannot_find_prog_unit then
267 --
268 hr_api.cannot_find_prog_unit_error
269 (p_module_name => 'HR_WINDOW_PROPERTIES_B'
270 ,p_hook_type => 'AD');
271 --
272 end;
273 --
274 hr_utility.set_location(' Leaving:'||l_proc, 10);
275 End post_delete;
276 --
277 -- ----------------------------------------------------------------------------
278 -- |---------------------------------< del >----------------------------------|
279 -- ----------------------------------------------------------------------------
280 Procedure del
281 (p_rec in hr_wnp_shd.g_rec_type
282 ) is
283 --
284 l_proc varchar2(72) := g_package||'del';
285 --
286 Begin
287 hr_utility.set_location('Entering:'||l_proc, 5);
288 --
289 -- We must lock the row which we need to delete.
290 --
291 hr_wnp_shd.lck
292 (p_rec.window_property_id
293 );
294 --
295 -- Call the supporting delete validate operation
296 --
297 hr_wnp_bus.delete_validate(p_rec);
298 --
299 -- Call the supporting pre-delete operation
300 --
301 hr_wnp_del.pre_delete(p_rec);
302 --
303 -- Delete the row.
304 --
305 hr_wnp_del.delete_dml(p_rec);
306 --
307 -- Call the supporting post-delete operation
308 --
309 hr_wnp_del.post_delete(p_rec);
310 --
311 End del;
312 --
313 -- ----------------------------------------------------------------------------
314 -- |---------------------------------< del >----------------------------------|
315 -- ----------------------------------------------------------------------------
316 Procedure del
317 (p_window_property_id in number
318 ) is
319 --
320 l_rec hr_wnp_shd.g_rec_type;
321 l_proc varchar2(72) := g_package||'del';
322 --
323 Begin
324 hr_utility.set_location('Entering:'||l_proc, 5);
325 --
326 -- As the delete procedure accepts a plsql record structure we do need to
327 -- convert the arguments into the record structure.
328 -- We don't need to call the supplied conversion argument routine as we
329 -- only need a few attributes.
330 --
331 l_rec.window_property_id := p_window_property_id;
332 --
333 --
334 -- Having converted the arguments into the hr_wnp_rec
335 -- plsql record structure we must call the corresponding entity
336 -- business process
337 --
338 hr_wnp_del.del(l_rec);
339 --
340 hr_utility.set_location(' Leaving:'||l_proc, 10);
341 End del;
342 --
343 end hr_wnp_del;