1 Package Body ben_xfi_upd as
2 /* $Header: bexfirhi.pkb 120.0 2005/05/28 12:33:36 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_xfi_upd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< update_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the actual dml update logic. The processing of
17 -- this procedure is:
18 -- 1) Increment the object_version_number by 1 if the object_version_number
19 -- is defined as an attribute for this entity.
20 -- 2) To set and unset the g_api_dml status as required (as we are about to
21 -- perform dml).
22 -- 3) To update the specified row in the schema using the primary key in
23 -- the predicates.
24 -- 4) To trap any constraint violations that may have occurred.
25 -- 5) To raise any other errors.
26 --
27 -- Prerequisites:
28 -- This is an internal private procedure which must be called from the upd
29 -- procedure.
30 --
31 -- In Parameters:
32 -- A Pl/Sql record structre.
33 --
34 -- Post Success:
35 -- The specified row will be updated in the schema.
36 --
37 -- Post Failure:
38 -- On the update dml failure it is important to note that we always reset the
39 -- g_api_dml status to false.
40 -- If a check, unique or parent integrity constraint violation is raised the
41 -- constraint_error procedure will be called.
42 -- If any other error is reported, the error will be raised after the
43 -- g_api_dml status is reset.
44 --
45 -- Developer Implementation Notes:
46 -- The update 'set' attribute list should be modified if any of your
47 -- attributes are not updateable.
48 --
49 -- Access Status:
50 -- Internal Row Handler Use Only.
51 --
52 -- {End Of Comments}
53 -- ----------------------------------------------------------------------------
54 Procedure update_dml(p_rec in out nocopy ben_xfi_shd.g_rec_type) is
55 --
56 l_proc varchar2(72) := g_package||'update_dml';
57 --
58 Begin
59 hr_utility.set_location('Entering:'||l_proc, 5);
60 --
61 -- Increment the object version
62 --
63 p_rec.object_version_number := p_rec.object_version_number + 1;
64 --
65 ben_xfi_shd.g_api_dml := true; -- Set the api dml status
66 --
67 -- Update the ben_ext_file Row
68 --
69 update ben_ext_file
70 set
71 ext_file_id = p_rec.ext_file_id,
72 name = p_rec.name,
73 xml_tag_name = p_rec.xml_tag_name,
74 business_group_id = p_rec.business_group_id,
75 legislation_code = p_rec.legislation_code,
76 xfi_attribute_category = p_rec.xfi_attribute_category,
77 xfi_attribute1 = p_rec.xfi_attribute1,
78 xfi_attribute2 = p_rec.xfi_attribute2,
79 xfi_attribute3 = p_rec.xfi_attribute3,
80 xfi_attribute4 = p_rec.xfi_attribute4,
81 xfi_attribute5 = p_rec.xfi_attribute5,
82 xfi_attribute6 = p_rec.xfi_attribute6,
83 xfi_attribute7 = p_rec.xfi_attribute7,
84 xfi_attribute8 = p_rec.xfi_attribute8,
85 xfi_attribute9 = p_rec.xfi_attribute9,
86 xfi_attribute10 = p_rec.xfi_attribute10,
87 xfi_attribute11 = p_rec.xfi_attribute11,
88 xfi_attribute12 = p_rec.xfi_attribute12,
89 xfi_attribute13 = p_rec.xfi_attribute13,
90 xfi_attribute14 = p_rec.xfi_attribute14,
91 xfi_attribute15 = p_rec.xfi_attribute15,
92 xfi_attribute16 = p_rec.xfi_attribute16,
93 xfi_attribute17 = p_rec.xfi_attribute17,
94 xfi_attribute18 = p_rec.xfi_attribute18,
95 xfi_attribute19 = p_rec.xfi_attribute19,
96 xfi_attribute20 = p_rec.xfi_attribute20,
97 xfi_attribute21 = p_rec.xfi_attribute21,
98 xfi_attribute22 = p_rec.xfi_attribute22,
99 xfi_attribute23 = p_rec.xfi_attribute23,
100 xfi_attribute24 = p_rec.xfi_attribute24,
101 xfi_attribute25 = p_rec.xfi_attribute25,
102 xfi_attribute26 = p_rec.xfi_attribute26,
103 xfi_attribute27 = p_rec.xfi_attribute27,
104 xfi_attribute28 = p_rec.xfi_attribute28,
105 xfi_attribute29 = p_rec.xfi_attribute29,
106 xfi_attribute30 = p_rec.xfi_attribute30,
107 ext_rcd_in_file_id = p_rec.ext_rcd_in_file_id ,
108 ext_data_elmt_in_rcd_id1 = p_rec.ext_data_elmt_in_rcd_id1 ,
109 ext_data_elmt_in_rcd_id2 = p_rec.ext_data_elmt_in_rcd_id2 ,
110 last_update_date = p_rec.last_update_date,
111 last_updated_by = p_rec.last_updated_by,
112 last_update_login = p_rec.last_update_login,
113 object_version_number = p_rec.object_version_number
114 where ext_file_id = p_rec.ext_file_id;
115 --
116 ben_xfi_shd.g_api_dml := false; -- Unset the api dml status
117 --
118 hr_utility.set_location(' Leaving:'||l_proc, 10);
119 --
120 Exception
121 When hr_api.check_integrity_violated Then
122 -- A check constraint has been violated
123 ben_xfi_shd.g_api_dml := false; -- Unset the api dml status
124 ben_xfi_shd.constraint_error
125 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
126 When hr_api.parent_integrity_violated Then
127 -- Parent integrity has been violated
128 ben_xfi_shd.g_api_dml := false; -- Unset the api dml status
129 ben_xfi_shd.constraint_error
130 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
131 When hr_api.unique_integrity_violated Then
132 -- Unique integrity has been violated
133 ben_xfi_shd.g_api_dml := false; -- Unset the api dml status
134 ben_xfi_shd.constraint_error
135 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
136 When Others Then
137 ben_xfi_shd.g_api_dml := false; -- Unset the api dml status
138 Raise;
139 End update_dml;
140 --
141 -- ----------------------------------------------------------------------------
142 -- |------------------------------< pre_update >------------------------------|
143 -- ----------------------------------------------------------------------------
144 -- {Start Of Comments}
145 --
146 -- Description:
147 -- This private procedure contains any processing which is required before
148 -- the update dml.
149 --
150 -- Prerequisites:
151 -- This is an internal procedure which is called from the upd procedure.
152 --
153 -- In Parameters:
154 -- A Pl/Sql record structre.
155 --
156 -- Post Success:
157 -- Processing continues.
158 --
159 -- Post Failure:
160 -- If an error has occurred, an error message and exception will be raised
161 -- but not handled.
162 --
163 -- Developer Implementation Notes:
164 -- Any pre-processing required before the update dml is issued should be
165 -- coded within this procedure. It is important to note that any 3rd party
166 -- maintenance should be reviewed before placing in this procedure.
167 --
168 -- Access Status:
169 -- Internal Row Handler Use Only.
170 --
171 -- {End Of Comments}
172 -- ----------------------------------------------------------------------------
173 Procedure pre_update(p_rec in ben_xfi_shd.g_rec_type) is
174 --
175 l_proc varchar2(72) := g_package||'pre_update';
176 --
177 Begin
178 hr_utility.set_location('Entering:'||l_proc, 5);
179 --
180 hr_utility.set_location(' Leaving:'||l_proc, 10);
181 End pre_update;
182 --
183 -- ----------------------------------------------------------------------------
184 -- |-----------------------------< post_update >------------------------------|
185 -- ----------------------------------------------------------------------------
186 -- {Start Of Comments}
187 --
188 -- Description:
189 -- This private procedure contains any processing which is required after the
190 -- update dml.
191 --
192 -- Prerequisites:
193 -- This is an internal procedure which is called from the upd procedure.
194 --
195 -- In Parameters:
196 -- A Pl/Sql record structre.
197 --
198 -- Post Success:
199 -- Processing continues.
200 --
201 -- Post Failure:
202 -- If an error has occurred, an error message and exception will be raised
203 -- but not handled.
204 --
205 -- Developer Implementation Notes:
206 -- Any post-processing required after the update dml is issued should be
207 -- coded within this procedure. It is important to note that any 3rd party
208 -- maintenance should be reviewed before placing in this procedure.
209 --
210 -- Access Status:
211 -- Internal Row Handler Use Only.
212 --
213 -- {End Of Comments}
214 -- ----------------------------------------------------------------------------
215 Procedure post_update(p_rec in ben_xfi_shd.g_rec_type) is
216 --
217 l_proc varchar2(72) := g_package||'post_update';
218 --
219 Begin
220 hr_utility.set_location('Entering:'||l_proc, 5);
221 --
222 --
223 -- Start of API User Hook for post_update.
224 --
225 begin
226 --
227 ben_xfi_rku.after_update
228 (
229 p_ext_file_id =>p_rec.ext_file_id
230 ,p_name =>p_rec.name
231 ,p_xml_tag_name =>p_rec.xml_tag_name
232 ,p_business_group_id =>p_rec.business_group_id
233 ,p_legislation_code =>p_rec.legislation_code
234 ,p_xfi_attribute_category =>p_rec.xfi_attribute_category
235 ,p_xfi_attribute1 =>p_rec.xfi_attribute1
236 ,p_xfi_attribute2 =>p_rec.xfi_attribute2
237 ,p_xfi_attribute3 =>p_rec.xfi_attribute3
238 ,p_xfi_attribute4 =>p_rec.xfi_attribute4
239 ,p_xfi_attribute5 =>p_rec.xfi_attribute5
240 ,p_xfi_attribute6 =>p_rec.xfi_attribute6
241 ,p_xfi_attribute7 =>p_rec.xfi_attribute7
242 ,p_xfi_attribute8 =>p_rec.xfi_attribute8
243 ,p_xfi_attribute9 =>p_rec.xfi_attribute9
244 ,p_xfi_attribute10 =>p_rec.xfi_attribute10
245 ,p_xfi_attribute11 =>p_rec.xfi_attribute11
246 ,p_xfi_attribute12 =>p_rec.xfi_attribute12
247 ,p_xfi_attribute13 =>p_rec.xfi_attribute13
248 ,p_xfi_attribute14 =>p_rec.xfi_attribute14
249 ,p_xfi_attribute15 =>p_rec.xfi_attribute15
250 ,p_xfi_attribute16 =>p_rec.xfi_attribute16
251 ,p_xfi_attribute17 =>p_rec.xfi_attribute17
252 ,p_xfi_attribute18 =>p_rec.xfi_attribute18
253 ,p_xfi_attribute19 =>p_rec.xfi_attribute19
254 ,p_xfi_attribute20 =>p_rec.xfi_attribute20
255 ,p_xfi_attribute21 =>p_rec.xfi_attribute21
256 ,p_xfi_attribute22 =>p_rec.xfi_attribute22
257 ,p_xfi_attribute23 =>p_rec.xfi_attribute23
258 ,p_xfi_attribute24 =>p_rec.xfi_attribute24
259 ,p_xfi_attribute25 =>p_rec.xfi_attribute25
260 ,p_xfi_attribute26 =>p_rec.xfi_attribute26
261 ,p_xfi_attribute27 =>p_rec.xfi_attribute27
262 ,p_xfi_attribute28 =>p_rec.xfi_attribute28
263 ,p_xfi_attribute29 =>p_rec.xfi_attribute29
264 ,p_xfi_attribute30 =>p_rec.xfi_attribute30
265 ,p_ext_rcd_in_file_id => p_rec.ext_rcd_in_file_id
266 ,p_ext_data_elmt_in_rcd_id1 => p_rec.ext_data_elmt_in_rcd_id1
267 ,p_ext_data_elmt_in_rcd_id2 => p_rec.ext_data_elmt_in_rcd_id2
268 ,p_object_version_number =>p_rec.object_version_number
269 ,p_name_o =>ben_xfi_shd.g_old_rec.name
270 ,p_xml_tag_name_o =>ben_xfi_shd.g_old_rec.xml_tag_name
271 ,p_business_group_id_o =>ben_xfi_shd.g_old_rec.business_group_id
272 ,p_legislation_code_o =>ben_xfi_shd.g_old_rec.legislation_code
273 ,p_xfi_attribute_category_o =>ben_xfi_shd.g_old_rec.xfi_attribute_category
274 ,p_xfi_attribute1_o =>ben_xfi_shd.g_old_rec.xfi_attribute1
275 ,p_xfi_attribute2_o =>ben_xfi_shd.g_old_rec.xfi_attribute2
276 ,p_xfi_attribute3_o =>ben_xfi_shd.g_old_rec.xfi_attribute3
277 ,p_xfi_attribute4_o =>ben_xfi_shd.g_old_rec.xfi_attribute4
278 ,p_xfi_attribute5_o =>ben_xfi_shd.g_old_rec.xfi_attribute5
279 ,p_xfi_attribute6_o =>ben_xfi_shd.g_old_rec.xfi_attribute6
280 ,p_xfi_attribute7_o =>ben_xfi_shd.g_old_rec.xfi_attribute7
281 ,p_xfi_attribute8_o =>ben_xfi_shd.g_old_rec.xfi_attribute8
282 ,p_xfi_attribute9_o =>ben_xfi_shd.g_old_rec.xfi_attribute9
283 ,p_xfi_attribute10_o =>ben_xfi_shd.g_old_rec.xfi_attribute10
284 ,p_xfi_attribute11_o =>ben_xfi_shd.g_old_rec.xfi_attribute11
285 ,p_xfi_attribute12_o =>ben_xfi_shd.g_old_rec.xfi_attribute12
286 ,p_xfi_attribute13_o =>ben_xfi_shd.g_old_rec.xfi_attribute13
287 ,p_xfi_attribute14_o =>ben_xfi_shd.g_old_rec.xfi_attribute14
288 ,p_xfi_attribute15_o =>ben_xfi_shd.g_old_rec.xfi_attribute15
289 ,p_xfi_attribute16_o =>ben_xfi_shd.g_old_rec.xfi_attribute16
290 ,p_xfi_attribute17_o =>ben_xfi_shd.g_old_rec.xfi_attribute17
291 ,p_xfi_attribute18_o =>ben_xfi_shd.g_old_rec.xfi_attribute18
292 ,p_xfi_attribute19_o =>ben_xfi_shd.g_old_rec.xfi_attribute19
293 ,p_xfi_attribute20_o =>ben_xfi_shd.g_old_rec.xfi_attribute20
294 ,p_xfi_attribute21_o =>ben_xfi_shd.g_old_rec.xfi_attribute21
295 ,p_xfi_attribute22_o =>ben_xfi_shd.g_old_rec.xfi_attribute22
296 ,p_xfi_attribute23_o =>ben_xfi_shd.g_old_rec.xfi_attribute23
297 ,p_xfi_attribute24_o =>ben_xfi_shd.g_old_rec.xfi_attribute24
298 ,p_xfi_attribute25_o =>ben_xfi_shd.g_old_rec.xfi_attribute25
299 ,p_xfi_attribute26_o =>ben_xfi_shd.g_old_rec.xfi_attribute26
300 ,p_xfi_attribute27_o =>ben_xfi_shd.g_old_rec.xfi_attribute27
301 ,p_xfi_attribute28_o =>ben_xfi_shd.g_old_rec.xfi_attribute28
302 ,p_xfi_attribute29_o =>ben_xfi_shd.g_old_rec.xfi_attribute29
303 ,p_xfi_attribute30_o =>ben_xfi_shd.g_old_rec.xfi_attribute30
304 ,p_ext_rcd_in_file_id_o => ben_xfi_shd.g_old_rec.ext_rcd_in_file_id
305 ,p_ext_data_elmt_in_rcd_id1_o => ben_xfi_shd.g_old_rec.ext_data_elmt_in_rcd_id1
306 ,p_ext_data_elmt_in_rcd_id2_o => ben_xfi_shd.g_old_rec.ext_data_elmt_in_rcd_id2
307 ,p_object_version_number_o =>ben_xfi_shd.g_old_rec.object_version_number
308 );
309 --
310 exception
311 --
312 when hr_api.cannot_find_prog_unit then
313 --
314 hr_api.cannot_find_prog_unit_error
315 (p_module_name => 'ben_ext_file'
316 ,p_hook_type => 'AU');
317 --
318 end;
319 --
320 -- End of API User Hook for post_update.
321 --
322 --
323 hr_utility.set_location(' Leaving:'||l_proc, 10);
324 End post_update;
325 --
326 -- ----------------------------------------------------------------------------
327 -- |-----------------------------< convert_defs >-----------------------------|
328 -- ----------------------------------------------------------------------------
329 -- {Start Of Comments}
330 --
331 -- Description:
332 -- The Convert_Defs procedure has one very important function:
333 -- It must return the record structure for the row with all system defaulted
334 -- values converted into its corresponding parameter value for update. When
335 -- we attempt to update a row through the Upd process , certain
336 -- parameters can be defaulted which enables flexibility in the calling of
337 -- the upd process (e.g. only attributes which need to be updated need to be
338 -- specified). For the upd process to determine which attributes
339 -- have NOT been specified we need to check if the parameter has a reserved
340 -- system default value. Therefore, for all parameters which have a
341 -- corresponding reserved system default mechanism specified we need to
342 -- check if a system default is being used. If a system default is being
343 -- used then we convert the defaulted value into its corresponding attribute
344 -- value held in the g_old_rec data structure.
345 --
346 -- Prerequisites:
347 -- This private function can only be called from the upd process.
348 --
349 -- In Parameters:
350 -- A Pl/Sql record structre.
351 --
352 -- Post Success:
353 -- The record structure will be returned with all system defaulted parameter
354 -- values converted into its current row attribute value.
355 --
356 -- Post Failure:
357 -- No direct error handling is required within this function. Any possible
358 -- errors within this procedure will be a PL/SQL value error due to conversion
359 -- of datatypes or data lengths.
360 --
361 -- Developer Implementation Notes:
362 -- None.
363 --
364 -- Access Status:
365 -- Internal Row Handler Use Only.
366 --
367 -- {End Of Comments}
368 -- ----------------------------------------------------------------------------
369 Procedure convert_defs(p_rec in out nocopy ben_xfi_shd.g_rec_type) is
370 --
371 l_proc varchar2(72) := g_package||'convert_defs';
372 --
373 Begin
374 --
375 hr_utility.set_location('Entering:'||l_proc, 5);
376 --
377 -- We must now examine each argument value in the
378 -- p_rec plsql record structure
379 -- to see if a system default is being used. If a system default
380 -- is being used then we must set to the 'current' argument value.
381 --
382 If (p_rec.name = hr_api.g_varchar2) then
383 p_rec.name :=
384 ben_xfi_shd.g_old_rec.name;
385 End If;
386
387 If (p_rec.xml_tag_name = hr_api.g_varchar2) then
388 p_rec.xml_tag_name :=
389 ben_xfi_shd.g_old_rec.xml_tag_name;
390 End If;
391 If (p_rec.business_group_id = hr_api.g_number) then
392 p_rec.business_group_id :=
393 ben_xfi_shd.g_old_rec.business_group_id;
394 End If;
395 If (p_rec.legislation_code = hr_api.g_varchar2) then
396 p_rec.legislation_code :=
397 ben_xfi_shd.g_old_rec.legislation_code;
398 End If;
399 If (p_rec.xfi_attribute_category = hr_api.g_varchar2) then
400 p_rec.xfi_attribute_category :=
401 ben_xfi_shd.g_old_rec.xfi_attribute_category;
402 End If;
403 If (p_rec.xfi_attribute1 = hr_api.g_varchar2) then
404 p_rec.xfi_attribute1 :=
405 ben_xfi_shd.g_old_rec.xfi_attribute1;
406 End If;
407 If (p_rec.xfi_attribute2 = hr_api.g_varchar2) then
408 p_rec.xfi_attribute2 :=
409 ben_xfi_shd.g_old_rec.xfi_attribute2;
410 End If;
411 If (p_rec.xfi_attribute3 = hr_api.g_varchar2) then
412 p_rec.xfi_attribute3 :=
413 ben_xfi_shd.g_old_rec.xfi_attribute3;
414 End If;
415 If (p_rec.xfi_attribute4 = hr_api.g_varchar2) then
416 p_rec.xfi_attribute4 :=
417 ben_xfi_shd.g_old_rec.xfi_attribute4;
418 End If;
419 If (p_rec.xfi_attribute5 = hr_api.g_varchar2) then
420 p_rec.xfi_attribute5 :=
421 ben_xfi_shd.g_old_rec.xfi_attribute5;
422 End If;
423 If (p_rec.xfi_attribute6 = hr_api.g_varchar2) then
424 p_rec.xfi_attribute6 :=
425 ben_xfi_shd.g_old_rec.xfi_attribute6;
426 End If;
427 If (p_rec.xfi_attribute7 = hr_api.g_varchar2) then
428 p_rec.xfi_attribute7 :=
429 ben_xfi_shd.g_old_rec.xfi_attribute7;
430 End If;
431 If (p_rec.xfi_attribute8 = hr_api.g_varchar2) then
432 p_rec.xfi_attribute8 :=
433 ben_xfi_shd.g_old_rec.xfi_attribute8;
434 End If;
435 If (p_rec.xfi_attribute9 = hr_api.g_varchar2) then
436 p_rec.xfi_attribute9 :=
437 ben_xfi_shd.g_old_rec.xfi_attribute9;
438 End If;
439 If (p_rec.xfi_attribute10 = hr_api.g_varchar2) then
440 p_rec.xfi_attribute10 :=
441 ben_xfi_shd.g_old_rec.xfi_attribute10;
442 End If;
443 If (p_rec.xfi_attribute11 = hr_api.g_varchar2) then
444 p_rec.xfi_attribute11 :=
445 ben_xfi_shd.g_old_rec.xfi_attribute11;
446 End If;
447 If (p_rec.xfi_attribute12 = hr_api.g_varchar2) then
448 p_rec.xfi_attribute12 :=
449 ben_xfi_shd.g_old_rec.xfi_attribute12;
450 End If;
451 If (p_rec.xfi_attribute13 = hr_api.g_varchar2) then
452 p_rec.xfi_attribute13 :=
453 ben_xfi_shd.g_old_rec.xfi_attribute13;
454 End If;
455 If (p_rec.xfi_attribute14 = hr_api.g_varchar2) then
456 p_rec.xfi_attribute14 :=
457 ben_xfi_shd.g_old_rec.xfi_attribute14;
458 End If;
459 If (p_rec.xfi_attribute15 = hr_api.g_varchar2) then
460 p_rec.xfi_attribute15 :=
461 ben_xfi_shd.g_old_rec.xfi_attribute15;
462 End If;
463 If (p_rec.xfi_attribute16 = hr_api.g_varchar2) then
464 p_rec.xfi_attribute16 :=
465 ben_xfi_shd.g_old_rec.xfi_attribute16;
466 End If;
467 If (p_rec.xfi_attribute17 = hr_api.g_varchar2) then
468 p_rec.xfi_attribute17 :=
469 ben_xfi_shd.g_old_rec.xfi_attribute17;
470 End If;
471 If (p_rec.xfi_attribute18 = hr_api.g_varchar2) then
472 p_rec.xfi_attribute18 :=
473 ben_xfi_shd.g_old_rec.xfi_attribute18;
474 End If;
475 If (p_rec.xfi_attribute19 = hr_api.g_varchar2) then
476 p_rec.xfi_attribute19 :=
477 ben_xfi_shd.g_old_rec.xfi_attribute19;
478 End If;
479 If (p_rec.xfi_attribute20 = hr_api.g_varchar2) then
480 p_rec.xfi_attribute20 :=
481 ben_xfi_shd.g_old_rec.xfi_attribute20;
482 End If;
483 If (p_rec.xfi_attribute21 = hr_api.g_varchar2) then
484 p_rec.xfi_attribute21 :=
485 ben_xfi_shd.g_old_rec.xfi_attribute21;
486 End If;
487 If (p_rec.xfi_attribute22 = hr_api.g_varchar2) then
488 p_rec.xfi_attribute22 :=
489 ben_xfi_shd.g_old_rec.xfi_attribute22;
490 End If;
491 If (p_rec.xfi_attribute23 = hr_api.g_varchar2) then
492 p_rec.xfi_attribute23 :=
493 ben_xfi_shd.g_old_rec.xfi_attribute23;
494 End If;
495 If (p_rec.xfi_attribute24 = hr_api.g_varchar2) then
496 p_rec.xfi_attribute24 :=
497 ben_xfi_shd.g_old_rec.xfi_attribute24;
498 End If;
499 If (p_rec.xfi_attribute25 = hr_api.g_varchar2) then
500 p_rec.xfi_attribute25 :=
501 ben_xfi_shd.g_old_rec.xfi_attribute25;
502 End If;
503 If (p_rec.xfi_attribute26 = hr_api.g_varchar2) then
504 p_rec.xfi_attribute26 :=
505 ben_xfi_shd.g_old_rec.xfi_attribute26;
506 End If;
507 If (p_rec.xfi_attribute27 = hr_api.g_varchar2) then
508 p_rec.xfi_attribute27 :=
509 ben_xfi_shd.g_old_rec.xfi_attribute27;
510 End If;
511 If (p_rec.xfi_attribute28 = hr_api.g_varchar2) then
512 p_rec.xfi_attribute28 :=
513 ben_xfi_shd.g_old_rec.xfi_attribute28;
514 End If;
515 If (p_rec.xfi_attribute29 = hr_api.g_varchar2) then
516 p_rec.xfi_attribute29 :=
517 ben_xfi_shd.g_old_rec.xfi_attribute29;
518 End If;
519 If (p_rec.xfi_attribute30 = hr_api.g_varchar2) then
520 p_rec.xfi_attribute30 :=
521 ben_xfi_shd.g_old_rec.xfi_attribute30;
522 End If;
523
524 If (p_rec.ext_rcd_in_file_id = hr_api.g_number) then
525 p_rec.ext_rcd_in_file_id :=
526 ben_xfi_shd.g_old_rec.ext_rcd_in_file_id;
527 End If;
528
529 If (p_rec.ext_data_elmt_in_rcd_id1 = hr_api.g_number) then
530 p_rec.ext_data_elmt_in_rcd_id1 :=
531 ben_xfi_shd.g_old_rec.ext_data_elmt_in_rcd_id1;
532 End If;
533
534 If (p_rec.ext_data_elmt_in_rcd_id2 = hr_api.g_number) then
535 p_rec.ext_data_elmt_in_rcd_id2 :=
536 ben_xfi_shd.g_old_rec.ext_data_elmt_in_rcd_id2;
537 End If;
538 --
539 hr_utility.set_location(' Leaving:'||l_proc, 10);
540 --
541 End convert_defs;
542 --
543 -- ----------------------------------------------------------------------------
544 -- |---------------------------------< upd >----------------------------------|
545 -- ----------------------------------------------------------------------------
546 Procedure upd
547 (
548 p_rec in out nocopy ben_xfi_shd.g_rec_type
549 ) is
550 --
551 l_proc varchar2(72) := g_package||'upd';
552 --
553 Begin
554 hr_utility.set_location('Entering:'||l_proc, 5);
555 --
556 -- We must lock the row which we need to update.
557 --
558 ben_xfi_shd.lck
559 (
560 p_rec.ext_file_id,
561 p_rec.object_version_number
562 );
563 --
564 -- 1. During an update system defaults are used to determine if
565 -- arguments have been defaulted or not. We must therefore
566 -- derive the full record structure values to be updated.
567 --
568 -- 2. Call the supporting update validate operations.
569 --
570 convert_defs(p_rec);
571 ben_xfi_bus.update_validate(p_rec);
572 --
573 ben_xel_bus.chk_xml_name_format
574 ( p_xml_tag_name => p_rec.xml_tag_name
575 ) ;
576
577 -- Call the supporting pre-update operation
578 --
579 pre_update(p_rec);
580 --
581 -- Update the row.
582 --
583 update_dml(p_rec);
584 --
585 -- Call the supporting post-update operation
586 --
587 post_update(p_rec);
588 End upd;
589 --
590 -- ----------------------------------------------------------------------------
591 -- |---------------------------------< upd >----------------------------------|
592 -- ----------------------------------------------------------------------------
593 Procedure upd
594 (
595 p_ext_file_id in number,
596 p_name in varchar2 default hr_api.g_varchar2,
597 p_xml_tag_name in varchar2 default hr_api.g_varchar2,
598 p_business_group_id in number default hr_api.g_number,
599 p_legislation_code in varchar2 default hr_api.g_varchar2,
600 p_xfi_attribute_category in varchar2 default hr_api.g_varchar2,
601 p_xfi_attribute1 in varchar2 default hr_api.g_varchar2,
602 p_xfi_attribute2 in varchar2 default hr_api.g_varchar2,
603 p_xfi_attribute3 in varchar2 default hr_api.g_varchar2,
604 p_xfi_attribute4 in varchar2 default hr_api.g_varchar2,
605 p_xfi_attribute5 in varchar2 default hr_api.g_varchar2,
606 p_xfi_attribute6 in varchar2 default hr_api.g_varchar2,
607 p_xfi_attribute7 in varchar2 default hr_api.g_varchar2,
608 p_xfi_attribute8 in varchar2 default hr_api.g_varchar2,
609 p_xfi_attribute9 in varchar2 default hr_api.g_varchar2,
610 p_xfi_attribute10 in varchar2 default hr_api.g_varchar2,
611 p_xfi_attribute11 in varchar2 default hr_api.g_varchar2,
612 p_xfi_attribute12 in varchar2 default hr_api.g_varchar2,
613 p_xfi_attribute13 in varchar2 default hr_api.g_varchar2,
614 p_xfi_attribute14 in varchar2 default hr_api.g_varchar2,
615 p_xfi_attribute15 in varchar2 default hr_api.g_varchar2,
616 p_xfi_attribute16 in varchar2 default hr_api.g_varchar2,
617 p_xfi_attribute17 in varchar2 default hr_api.g_varchar2,
618 p_xfi_attribute18 in varchar2 default hr_api.g_varchar2,
619 p_xfi_attribute19 in varchar2 default hr_api.g_varchar2,
620 p_xfi_attribute20 in varchar2 default hr_api.g_varchar2,
621 p_xfi_attribute21 in varchar2 default hr_api.g_varchar2,
622 p_xfi_attribute22 in varchar2 default hr_api.g_varchar2,
623 p_xfi_attribute23 in varchar2 default hr_api.g_varchar2,
624 p_xfi_attribute24 in varchar2 default hr_api.g_varchar2,
625 p_xfi_attribute25 in varchar2 default hr_api.g_varchar2,
626 p_xfi_attribute26 in varchar2 default hr_api.g_varchar2,
627 p_xfi_attribute27 in varchar2 default hr_api.g_varchar2,
628 p_xfi_attribute28 in varchar2 default hr_api.g_varchar2,
629 p_xfi_attribute29 in varchar2 default hr_api.g_varchar2,
630 p_xfi_attribute30 in varchar2 default hr_api.g_varchar2,
631 p_ext_rcd_in_file_id in number default hr_api.g_number,
632 p_ext_data_elmt_in_rcd_id1 in number default hr_api.g_number ,
633 p_ext_data_elmt_in_rcd_id2 in number default hr_api.g_number ,
634 p_last_update_date in date default hr_api.g_date,
635 p_creation_date in date default hr_api.g_date,
636 p_last_updated_by in number default hr_api.g_number,
637 p_last_update_login in number default hr_api.g_number,
638 p_created_by in number default hr_api.g_number,
639 p_object_version_number in out nocopy number
640 ) is
641 --
642 l_rec ben_xfi_shd.g_rec_type;
643 l_proc varchar2(72) := g_package||'upd';
644 --
645 Begin
646 hr_utility.set_location('Entering:'||l_proc, 5);
647 --
648 -- Call conversion function to turn arguments into the
649 -- l_rec structure.
650 --
651 l_rec :=
652 ben_xfi_shd.convert_args
653 (
654 p_ext_file_id,
655 p_name,
656 p_xml_tag_name,
657 p_business_group_id,
658 p_legislation_code,
659 p_xfi_attribute_category,
660 p_xfi_attribute1,
661 p_xfi_attribute2,
662 p_xfi_attribute3,
663 p_xfi_attribute4,
664 p_xfi_attribute5,
665 p_xfi_attribute6,
666 p_xfi_attribute7,
667 p_xfi_attribute8,
668 p_xfi_attribute9,
669 p_xfi_attribute10,
670 p_xfi_attribute11,
671 p_xfi_attribute12,
672 p_xfi_attribute13,
673 p_xfi_attribute14,
674 p_xfi_attribute15,
675 p_xfi_attribute16,
676 p_xfi_attribute17,
677 p_xfi_attribute18,
678 p_xfi_attribute19,
679 p_xfi_attribute20,
680 p_xfi_attribute21,
681 p_xfi_attribute22,
682 p_xfi_attribute23,
683 p_xfi_attribute24,
684 p_xfi_attribute25,
685 p_xfi_attribute26,
686 p_xfi_attribute27,
687 p_xfi_attribute28,
688 p_xfi_attribute29,
689 p_xfi_attribute30,
690 p_ext_rcd_in_file_id ,
691 p_ext_data_elmt_in_rcd_id1,
692 p_ext_data_elmt_in_rcd_id2,
693 p_last_update_date ,
694 p_creation_date ,
695 p_last_updated_by ,
696 p_last_update_login,
697 p_created_by ,
698 p_object_version_number
699 );
700 --
701 -- Having converted the arguments into the
702 -- plsql record structure we call the corresponding record
703 -- business process.
704 --
705 upd(l_rec);
706 p_object_version_number := l_rec.object_version_number;
707 --
708 hr_utility.set_location(' Leaving:'||l_proc, 10);
709 End upd;
710 --
711 end ben_xfi_upd;