1 Package Body pqh_pte_del as
2 /* $Header: pqpterhi.pkb 115.11 2002/12/12 23:13:54 sgoyal noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pqh_pte_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 -- 2) To delete the specified row from the schema using the primary key in
19 -- the predicates.
20 -- 3) To trap any constraint violations that may have occurred.
21 -- 4) To raise any other errors.
22 --
23 -- Prerequisites:
24 -- This is an internal private procedure which must be called from the del
25 -- procedure.
26 --
27 -- In Parameters:
28 -- A Pl/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 Row Handler Use Only.
42 --
43 -- {End Of Comments}
44 -- ----------------------------------------------------------------------------
45 Procedure delete_dml(p_rec in pqh_pte_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 pqh_ptx_extra_info row.
54 --
55 delete from pqh_ptx_extra_info
56 where ptx_extra_info_id = p_rec.ptx_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 pqh_pte_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 -- Prerequisites:
80 -- This is an internal procedure which is called from the del procedure.
81 --
82 -- In Parameters:
83 -- A Pl/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 placing in this procedure.
96 --
97 -- Access Status:
98 -- Internal Row Handler Use Only.
99 --
100 -- {End Of Comments}
101 -- ----------------------------------------------------------------------------
102 Procedure pre_delete(p_rec in pqh_pte_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 -- Prerequisites:
122 -- This is an internal procedure which is called from the del procedure.
123 --
124 -- In Parameters:
125 -- A Pl/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 placing in this procedure.
138 --
139 -- Access Status:
140 -- Internal table Handler Use Only.
141 --
142 -- {End Of Comments}
143 -- ----------------------------------------------------------------------------
144 Procedure post_delete(p_rec in pqh_pte_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 --
152 -- Start of API User Hook for post_delete.
153 --
154 begin
155 --
156 pqh_pte_rkd.after_delete
157 (
158 p_ptx_extra_info_id =>p_rec.ptx_extra_info_id
159 ,p_information_type_o =>pqh_pte_shd.g_old_rec.information_type
160 ,p_position_transaction_id_o =>pqh_pte_shd.g_old_rec.position_transaction_id
161 ,p_position_extra_info_id_o =>pqh_pte_shd.g_old_rec.position_extra_info_id
162 ,p_information_category_o =>pqh_pte_shd.g_old_rec.information_category
163 ,p_information1_o =>pqh_pte_shd.g_old_rec.information1
164 ,p_information2_o =>pqh_pte_shd.g_old_rec.information2
165 ,p_information3_o =>pqh_pte_shd.g_old_rec.information3
166 ,p_information4_o =>pqh_pte_shd.g_old_rec.information4
167 ,p_information5_o =>pqh_pte_shd.g_old_rec.information5
168 ,p_information6_o =>pqh_pte_shd.g_old_rec.information6
169 ,p_information7_o =>pqh_pte_shd.g_old_rec.information7
170 ,p_information8_o =>pqh_pte_shd.g_old_rec.information8
171 ,p_information9_o =>pqh_pte_shd.g_old_rec.information9
172 ,p_information10_o =>pqh_pte_shd.g_old_rec.information10
173 ,p_information11_o =>pqh_pte_shd.g_old_rec.information11
174 ,p_information12_o =>pqh_pte_shd.g_old_rec.information12
175 ,p_information13_o =>pqh_pte_shd.g_old_rec.information13
176 ,p_information14_o =>pqh_pte_shd.g_old_rec.information14
177 ,p_information15_o =>pqh_pte_shd.g_old_rec.information15
178 ,p_information16_o =>pqh_pte_shd.g_old_rec.information16
179 ,p_information17_o =>pqh_pte_shd.g_old_rec.information17
180 ,p_information18_o =>pqh_pte_shd.g_old_rec.information18
181 ,p_information19_o =>pqh_pte_shd.g_old_rec.information19
182 ,p_information20_o =>pqh_pte_shd.g_old_rec.information20
183 ,p_information21_o =>pqh_pte_shd.g_old_rec.information21
184 ,p_information22_o =>pqh_pte_shd.g_old_rec.information22
185 ,p_information23_o =>pqh_pte_shd.g_old_rec.information23
186 ,p_information24_o =>pqh_pte_shd.g_old_rec.information24
187 ,p_information25_o =>pqh_pte_shd.g_old_rec.information25
188 ,p_information26_o =>pqh_pte_shd.g_old_rec.information26
189 ,p_information27_o =>pqh_pte_shd.g_old_rec.information27
190 ,p_information28_o =>pqh_pte_shd.g_old_rec.information28
191 ,p_information29_o =>pqh_pte_shd.g_old_rec.information29
192 ,p_information30_o =>pqh_pte_shd.g_old_rec.information30
193 ,p_attribute_category_o =>pqh_pte_shd.g_old_rec.attribute_category
194 ,p_attribute1_o =>pqh_pte_shd.g_old_rec.attribute1
195 ,p_attribute2_o =>pqh_pte_shd.g_old_rec.attribute2
196 ,p_attribute3_o =>pqh_pte_shd.g_old_rec.attribute3
197 ,p_attribute4_o =>pqh_pte_shd.g_old_rec.attribute4
198 ,p_attribute5_o =>pqh_pte_shd.g_old_rec.attribute5
199 ,p_attribute6_o =>pqh_pte_shd.g_old_rec.attribute6
200 ,p_attribute7_o =>pqh_pte_shd.g_old_rec.attribute7
201 ,p_attribute8_o =>pqh_pte_shd.g_old_rec.attribute8
202 ,p_attribute9_o =>pqh_pte_shd.g_old_rec.attribute9
203 ,p_attribute10_o =>pqh_pte_shd.g_old_rec.attribute10
204 ,p_attribute11_o =>pqh_pte_shd.g_old_rec.attribute11
205 ,p_attribute12_o =>pqh_pte_shd.g_old_rec.attribute12
206 ,p_attribute13_o =>pqh_pte_shd.g_old_rec.attribute13
207 ,p_attribute14_o =>pqh_pte_shd.g_old_rec.attribute14
208 ,p_attribute15_o =>pqh_pte_shd.g_old_rec.attribute15
209 ,p_attribute16_o =>pqh_pte_shd.g_old_rec.attribute16
210 ,p_attribute17_o =>pqh_pte_shd.g_old_rec.attribute17
211 ,p_attribute18_o =>pqh_pte_shd.g_old_rec.attribute18
212 ,p_attribute19_o =>pqh_pte_shd.g_old_rec.attribute19
213 ,p_attribute20_o =>pqh_pte_shd.g_old_rec.attribute20
214 ,p_object_version_number_o =>pqh_pte_shd.g_old_rec.object_version_number
215 );
216 --
217 exception
218 --
219 when hr_api.cannot_find_prog_unit then
220 --
221 hr_api.cannot_find_prog_unit_error
222 (p_module_name => 'pqh_ptx_extra_info'
223 ,p_hook_type => 'AD');
224 --
225 end;
226 --
227 -- End of API User Hook for post_delete.
228 --
229 --
230 hr_utility.set_location(' Leaving:'||l_proc, 10);
231 End post_delete;
232 --
233 -- ----------------------------------------------------------------------------
234 -- |---------------------------------< del >----------------------------------|
235 -- ----------------------------------------------------------------------------
236 Procedure del
237 (
238 p_rec in pqh_pte_shd.g_rec_type
239 ) is
240 --
241 l_proc varchar2(72) := g_package||'del';
242 --
243 Begin
244 hr_utility.set_location('Entering:'||l_proc, 5);
245 --
246 -- We must lock the row which we need to delete.
247 --
248 pqh_pte_shd.lck
249 (
250 p_rec.ptx_extra_info_id,
251 p_rec.object_version_number
252 );
253 --
254 -- Call the supporting delete validate operation
255 --
256 pqh_pte_bus.delete_validate(p_rec);
257 --
258 -- Call the supporting pre-delete operation
259 --
260 pre_delete(p_rec);
261 --
262 -- Delete the row.
263 --
264 delete_dml(p_rec);
265 --
266 -- Call the supporting post-delete operation
267 --
268 post_delete(p_rec);
269 End del;
270 --
271 -- ----------------------------------------------------------------------------
272 -- |---------------------------------< del >----------------------------------|
273 -- ----------------------------------------------------------------------------
274 Procedure del
275 (
276 p_ptx_extra_info_id in number,
277 p_object_version_number in number
278 ) is
279 --
280 l_rec pqh_pte_shd.g_rec_type;
281 l_proc varchar2(72) := g_package||'del';
282 --
283 Begin
284 hr_utility.set_location('Entering:'||l_proc, 5);
285 --
286 -- As the delete procedure accepts a plsql record structure we do need to
287 -- convert the arguments into the record structure.
288 -- We don't need to call the supplied conversion argument routine as we
289 -- only need a few attributes.
290 --
291 l_rec.ptx_extra_info_id:= p_ptx_extra_info_id;
292 l_rec.object_version_number := p_object_version_number;
293 --
294 -- Having converted the arguments into the pqh_pte_rec
295 -- plsql record structure we must call the corresponding entity
296 -- business process
297 --
298 del(l_rec);
299 --
300 hr_utility.set_location(' Leaving:'||l_proc, 10);
301 End del;
302 --
303 end pqh_pte_del;