1 Package Body ota_lpm_del as
2 /* $Header: otlpmrhi.pkb 120.0 2005/05/29 07:22:37 appldev noship $ */
3
4 --
5 -- ----------------------------------------------------------------------------
6 -- | Private Global Definitions |
7 -- ----------------------------------------------------------------------------
8 --
9 g_package varchar2(33) := ' ota_lpm_del.'; -- Global package name
10 --
11 -- ----------------------------------------------------------------------------
12 -- |------------------------------< delete_dml >------------------------------|
13 -- ----------------------------------------------------------------------------
14 -- {Start Of Comments}
15 --
16 -- Description:
17 -- This procedure controls the actual dml delete logic. The functions of
18 -- this procedure are as follows:
19 -- 1) To set and unset the g_api_dml status as required (as we are about to
20 -- perform dml).
21 -- 2) To delete the specified row from the schema using the primary key in
22 -- the predicates.
23 -- 3) To trap any constraint violations that may have occurred.
24 -- 4) To raise any other errors.
25 --
26 -- Prerequisites:
27 -- This is an internal private procedure which must be called from the del
28 -- procedure.
29 --
30 -- In Parameters:
31 -- A Pl/Sql record structre.
32 --
33 -- Post Success:
34 -- The specified row will be delete from the schema.
35 --
36 -- Post Failure:
37 -- On the delete dml failure it is important to note that we always reset the
38 -- g_api_dml status to false.
39 -- If a child integrity constraint violation is raised the
40 -- constraint_error procedure will be called.
41 -- If any other error is reported, the error will be raised after the
42 -- g_api_dml status is reset.
43 --
44 -- Developer Implementation Notes:
45 -- None.
46 --
47 -- Access Status:
48 -- Internal Row Handler Use Only.
49 --
50 -- {End Of Comments}
51 -- ----------------------------------------------------------------------------
52 Procedure delete_dml
53 (p_rec in ota_lpm_shd.g_rec_type
54 ) is
55 --
56 l_proc varchar2(72) := g_package||'delete_dml';
57 --
58 Begin
59 hr_utility.set_location('Entering:'||l_proc, 5);
60 --
61 --
62 --
63 -- Delete the ota_learning_path_members row.
64 --
65 delete from ota_learning_path_members
66 where learning_path_member_id = p_rec.learning_path_member_id;
67 --
68 --
69 --
70 hr_utility.set_location(' Leaving:'||l_proc, 10);
71 --
72 Exception
73 When hr_api.child_integrity_violated then
74 -- Child integrity has been violated
75 --
76 ota_lpm_shd.constraint_error
77 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
78 When Others Then
79 --
80 Raise;
81 End delete_dml;
82 --
83 -- ----------------------------------------------------------------------------
84 -- |------------------------------< pre_delete >------------------------------|
85 -- ----------------------------------------------------------------------------
86 -- {Start Of Comments}
87 --
88 -- Description:
89 -- This private procedure contains any processing which is required before
90 -- the delete dml.
91 --
92 -- Prerequisites:
93 -- This is an internal procedure which is called from the del procedure.
94 --
95 -- In Parameters:
96 -- A Pl/Sql record structre.
97 --
98 -- Post Success:
99 -- Processing continues.
100 --
101 -- Post Failure:
102 -- If an error has occurred, an error message and exception will be raised
103 -- but not handled.
104 --
105 -- Developer Implementation Notes:
106 -- Any pre-processing required before the delete dml is issued should be
107 -- coded within this procedure. It is important to note that any 3rd party
108 -- maintenance should be reviewed before placing in this procedure.
109 --
110 -- Access Status:
111 -- Internal Row Handler Use Only.
112 --
113 -- {End Of Comments}
114 -- ----------------------------------------------------------------------------
115 Procedure pre_delete(p_rec in ota_lpm_shd.g_rec_type) is
116 --
117 l_proc varchar2(72) := g_package||'pre_delete';
118 --
119 Begin
120 hr_utility.set_location('Entering:'||l_proc, 5);
121 --
122 hr_utility.set_location(' Leaving:'||l_proc, 10);
123 End pre_delete;
124 --
125 -- ----------------------------------------------------------------------------
126 -- |-----------------------------< post_delete >------------------------------|
127 -- ----------------------------------------------------------------------------
128 -- {Start Of Comments}
129 --
130 -- Description:
131 -- This private procedure contains any processing which is required after
132 -- the delete dml.
133 --
134 -- Prerequistes:
135 -- This is an internal procedure which is called from the del procedure.
136 --
137 -- In Parameters:
138 -- A Pl/Sql record structure.
139 --
140 -- Post Success:
141 -- Processing continues.
142 --
143 -- Post Failure:
144 -- If an error has occurred, an error message and exception will be raised
145 -- but not handled.
146 --
147 -- Developer Implementation Notes:
148 -- Any post-processing required after the delete dml is issued should be
149 -- coded within this procedure. It is important to note that any 3rd party
150 -- maintenance should be reviewed before placing in this procedure.
151 --
152 -- Access Status:
153 -- Internal Row Handler Use Only.
154 --
155 -- {End Of Comments}
156 -- -----------------------------------------------------------------------------
157 Procedure post_delete(p_rec in ota_lpm_shd.g_rec_type) is
158 --
159 l_proc varchar2(72) := g_package||'post_delete';
160 --
161 Begin
162 hr_utility.set_location('Entering:'||l_proc, 5);
163 begin
164 --
165 ota_lpm_rkd.after_delete
166 (p_learning_path_member_id
167 => p_rec.learning_path_member_id
168 ,p_learning_path_id_o
169 => ota_lpm_shd.g_old_rec.learning_path_id
170 ,p_activity_version_id_o
171 => ota_lpm_shd.g_old_rec.activity_version_id
172 ,p_course_sequence_o
173 => ota_lpm_shd.g_old_rec.course_sequence
174 ,p_business_group_id_o
175 => ota_lpm_shd.g_old_rec.business_group_id
176 ,p_duration_o
177 => ota_lpm_shd.g_old_rec.duration
178 ,p_duration_units_o
179 => ota_lpm_shd.g_old_rec.duration_units
180 ,p_object_version_number_o
181 => ota_lpm_shd.g_old_rec.object_version_number
182 ,p_attribute_category_o
183 => ota_lpm_shd.g_old_rec.attribute_category
184 ,p_attribute1_o
185 => ota_lpm_shd.g_old_rec.attribute1
186 ,p_attribute2_o
187 => ota_lpm_shd.g_old_rec.attribute2
188 ,p_attribute3_o
189 => ota_lpm_shd.g_old_rec.attribute3
190 ,p_attribute4_o
191 => ota_lpm_shd.g_old_rec.attribute4
192 ,p_attribute5_o
193 => ota_lpm_shd.g_old_rec.attribute5
194 ,p_attribute6_o
195 => ota_lpm_shd.g_old_rec.attribute6
196 ,p_attribute7_o
197 => ota_lpm_shd.g_old_rec.attribute7
198 ,p_attribute8_o
199 => ota_lpm_shd.g_old_rec.attribute8
200 ,p_attribute9_o
201 => ota_lpm_shd.g_old_rec.attribute9
202 ,p_attribute10_o
203 => ota_lpm_shd.g_old_rec.attribute10
204 ,p_attribute11_o
205 => ota_lpm_shd.g_old_rec.attribute11
206 ,p_attribute12_o
207 => ota_lpm_shd.g_old_rec.attribute12
208 ,p_attribute13_o
209 => ota_lpm_shd.g_old_rec.attribute13
210 ,p_attribute14_o
211 => ota_lpm_shd.g_old_rec.attribute14
212 ,p_attribute15_o
213 => ota_lpm_shd.g_old_rec.attribute15
214 ,p_attribute16_o
215 => ota_lpm_shd.g_old_rec.attribute16
216 ,p_attribute17_o
217 => ota_lpm_shd.g_old_rec.attribute17
218 ,p_attribute18_o
219 => ota_lpm_shd.g_old_rec.attribute18
220 ,p_attribute19_o
221 => ota_lpm_shd.g_old_rec.attribute19
222 ,p_attribute20_o
223 => ota_lpm_shd.g_old_rec.attribute20
224 ,p_learning_path_section_id_o
225 => ota_lpm_shd.g_old_rec.learning_path_section_id
226 ,p_notify_days_before_target_o
227 => ota_lpm_shd.g_old_rec.notify_days_before_target
228 );
229 --
230 exception
231 --
232 when hr_api.cannot_find_prog_unit then
233 --
234 hr_api.cannot_find_prog_unit_error
235 (p_module_name => 'OTA_LEARNING_PATH_MEMBERS'
236 ,p_hook_type => 'AD');
237 --
238 end;
239 --
240 hr_utility.set_location(' Leaving:'||l_proc, 10);
241 End post_delete;
242 --
243 -- ----------------------------------------------------------------------------
244 -- |---------------------------------< del >----------------------------------|
245 -- ----------------------------------------------------------------------------
246 Procedure del
247 (p_rec in ota_lpm_shd.g_rec_type
248 ) is
249 --
250 l_proc varchar2(72) := g_package||'del';
251 --
252 Begin
253 hr_utility.set_location('Entering:'||l_proc, 5);
254 --
255 -- We must lock the row which we need to delete.
256 --
257 ota_lpm_shd.lck
258 (p_rec.learning_path_member_id
259 ,p_rec.object_version_number
260 );
261 --
262 -- Call the supporting delete validate operation
263 --
264 ota_lpm_bus.delete_validate(p_rec);
265 --
266 -- Call to raise any errors on multi-message list
267 hr_multi_message.end_validation_set;
268 --
269 -- Call the supporting pre-delete operation
270 --
271 ota_lpm_del.pre_delete(p_rec);
272 --
273 -- Delete the row.
274 --
275 ota_lpm_del.delete_dml(p_rec);
276 --
277 -- Call the supporting post-delete operation
278 --
279 ota_lpm_del.post_delete(p_rec);
283 --
280 --
281 -- Call to raise any errors on multi-message list
282 hr_multi_message.end_validation_set;
284 End del;
285 --
286 -- ----------------------------------------------------------------------------
287 -- |---------------------------------< del >----------------------------------|
288 -- ----------------------------------------------------------------------------
289 Procedure del
290 (p_learning_path_member_id in number
291 ,p_object_version_number in number
292 ) is
293 --
294 l_rec ota_lpm_shd.g_rec_type;
295 l_proc varchar2(72) := g_package||'del';
296 --
297 Begin
298 hr_utility.set_location('Entering:'||l_proc, 5);
299 --
300 -- As the delete procedure accepts a plsql record structure we do need to
301 -- convert the arguments into the record structure.
302 -- We don't need to call the supplied conversion argument routine as we
303 -- only need a few attributes.
304 --
305 l_rec.learning_path_member_id := p_learning_path_member_id;
306 l_rec.object_version_number := p_object_version_number;
307 --
308 -- Having converted the arguments into the ota_lpm_rec
309 -- plsql record structure we must call the corresponding entity
310 -- business process
311 --
312 ota_lpm_del.del(l_rec);
313 --
314 hr_utility.set_location(' Leaving:'||l_proc, 10);
315 End del;
316 --
317 end ota_lpm_del;