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