1 Package Body hxc_hph_upd as
2 /* $Header: hxchphrhi.pkb 120.2.12000000.2 2007/03/16 13:22:54 rchennur noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' hxc_hph_upd.'; -- Global package name
9 g_debug boolean := hr_utility.debug_enabled;
10 --
11 -- ----------------------------------------------------------------------------
12 -- |------------------------------< update_dml >------------------------------|
13 -- ----------------------------------------------------------------------------
14 -- {Start Of Comments}
15 --
16 -- Description:
17 -- This procedure controls the actual dml update logic. The processing of
18 -- this procedure is:
19 -- 1) Increment the object_version_number by 1 if the object_version_number
20 -- is defined as an attribute for this entity.
21 -- 2) To set and unset the g_api_dml status as required (as we are about to
22 -- perform dml).
23 -- 3) To update the specified row in the schema using the primary key in
24 -- the predicates.
25 -- 4) To trap any constraint violations that may have occurred.
26 -- 5) To raise any other errors.
27 --
28 -- Prerequisites:
29 -- This is an internal private procedure which must be called from the upd
30 -- procedure.
31 --
32 -- In Parameters:
33 -- A Pl/Sql record structre.
34 --
35 -- Post Success:
36 -- The specified row will be updated in the schema.
37 --
38 -- Post Failure:
39 -- On the update dml failure it is important to note that we always reset the
40 -- g_api_dml status to false.
41 -- If a check, unique or parent integrity constraint violation is raised the
42 -- constraint_error procedure will be called.
43 -- If any other error is reported, the error will be raised after the
44 -- g_api_dml status is reset.
45 --
46 -- Developer Implementation Notes:
47 -- The update 'set' attribute list should be modified if any of your
48 -- attributes are not updateable.
49 --
50 -- Access Status:
51 -- Internal Row Handler Use Only.
52 --
53 -- {End Of Comments}
54 -- ----------------------------------------------------------------------------
55 Procedure update_dml
56 (p_rec in out nocopy hxc_hph_shd.g_rec_type
57 ) is
58 --
59 l_proc varchar2(72);
60 --
61 Begin
62 if g_debug then
63 l_proc := g_package||'update_dml';
64 hr_utility.set_location('Entering:'||l_proc, 5);
65 end if;
66 --
67 -- Increment the object version
68 p_rec.object_version_number := p_rec.object_version_number + 1;
69 --
70 --
71 --
72 -- Update the hxc_pref_hierarchies Row
73 --
74 update hxc_pref_hierarchies
75 set
76 pref_hierarchy_id = p_rec.pref_hierarchy_id
77 ,type = p_rec.type
78 ,name = p_rec.name
79 ,business_group_id = p_rec.business_group_id
80 ,legislation_code = p_rec.legislation_code
81 ,parent_pref_hierarchy_id = p_rec.parent_pref_hierarchy_id
82 ,edit_allowed = p_rec.edit_allowed
83 ,displayed = p_rec.displayed
84 ,pref_definition_id = p_rec.pref_definition_id
85 ,attribute_category = p_rec.attribute_category
86 ,attribute1 = p_rec.attribute1
87 ,attribute2 = p_rec.attribute2
88 ,attribute3 = p_rec.attribute3
89 ,attribute4 = p_rec.attribute4
90 ,attribute5 = p_rec.attribute5
91 ,attribute6 = p_rec.attribute6
92 ,attribute7 = p_rec.attribute7
93 ,attribute8 = p_rec.attribute8
94 ,attribute9 = p_rec.attribute9
95 ,attribute10 = p_rec.attribute10
96 ,attribute11 = p_rec.attribute11
97 ,attribute12 = p_rec.attribute12
98 ,attribute13 = p_rec.attribute13
99 ,attribute14 = p_rec.attribute14
100 ,attribute15 = p_rec.attribute15
101 ,attribute16 = p_rec.attribute16
102 ,attribute17 = p_rec.attribute17
103 ,attribute18 = p_rec.attribute18
104 ,attribute19 = p_rec.attribute19
105 ,attribute20 = p_rec.attribute20
106 ,attribute21 = p_rec.attribute21
107 ,attribute22 = p_rec.attribute22
108 ,attribute23 = p_rec.attribute23
109 ,attribute24 = p_rec.attribute24
110 ,attribute25 = p_rec.attribute25
111 ,attribute26 = p_rec.attribute26
112 ,attribute27 = p_rec.attribute27
113 ,attribute28 = p_rec.attribute28
114 ,attribute29 = p_rec.attribute29
115 ,attribute30 = p_rec.attribute30
116 ,object_version_number = p_rec.object_version_number
117 ,orig_pref_hierarchy_id = p_rec.orig_pref_hierarchy_id
118 ,orig_parent_hierarchy_id = p_rec.orig_parent_hierarchy_id
119 ,top_level_parent_id = p_rec.top_level_parent_id --performance Fix
120 ,code = p_rec.code
121 ,last_updated_by = fnd_global.user_id
122 ,last_update_date = sysdate
123 ,last_update_login = fnd_global.login_id
124
125 where pref_hierarchy_id = p_rec.pref_hierarchy_id;
126 --
127 --
128 --
129 if g_debug then
130 hr_utility.set_location(' Leaving:'||l_proc, 10);
131 end if;
132 --
133 Exception
134 When hr_api.check_integrity_violated Then
135 -- A check constraint has been violated
136 --
137 hxc_hph_shd.constraint_error
138 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
139 When hr_api.parent_integrity_violated Then
140 -- Parent integrity has been violated
141 --
142 hxc_hph_shd.constraint_error
143 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
144 When hr_api.unique_integrity_violated Then
145 -- Unique integrity has been violated
146 --
147 hxc_hph_shd.constraint_error
148 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
149 When Others Then
150 --
151 Raise;
152 End update_dml;
153 --
154 -- ----------------------------------------------------------------------------
155 -- |------------------------------< pre_update >------------------------------|
156 -- ----------------------------------------------------------------------------
157 -- {Start Of Comments}
158 --
159 -- Description:
160 -- This private procedure contains any processing which is required before
161 -- the update dml.
162 --
163 -- Prerequisites:
164 -- This is an internal procedure which is called from the upd procedure.
165 --
166 -- In Parameters:
167 -- A Pl/Sql record structure.
168 --
169 -- Post Success:
170 -- Processing continues.
171 --
172 -- Post Failure:
173 -- If an error has occurred, an error message and exception wil be raised
174 -- but not handled.
175 --
176 -- Developer Implementation Notes:
177 -- Any pre-processing required before the update dml is issued should be
178 -- coded within this procedure. It is important to note that any 3rd party
179 -- maintenance should be reviewed before placing in this procedure.
180 --
181 -- Access Status:
182 -- Internal Row Handler Use Only.
183 --
184 -- {End Of Comments}
185 -- ----------------------------------------------------------------------------
186 Procedure pre_update
187 (p_rec in out nocopy hxc_hph_shd.g_rec_type
188 ) is
189 --
190 l_proc varchar2(72);
191 --Performance Fix
192 cursor c_top_level_node(p_pref_hierarchy_id number)
193 is
194 select pref_hierarchy_id
195 from hxc_pref_hierarchies
196 where parent_pref_hierarchy_id is null
197 connect by prior parent_pref_hierarchy_id = pref_hierarchy_id
198 start with pref_hierarchy_id = p_pref_hierarchy_id;
199
200 Cursor c_code(p_pref_definition_id number)
201 is
202 select hpd.code
203 from hxc_pref_definitions hpd
204 where pref_definition_id = p_pref_definition_id;
205
206 l_top_node_id number := p_rec.pref_hierarchy_id;
207 l_node_id number;
208 l_code varchar2(30);
209 --
210
211 --
212 Begin
213 if g_debug then
214 l_proc := g_package||'pre_update';
215 hr_utility.set_location('Entering:'||l_proc, 10);
216 end if;
217 --
218 --
219 if (p_rec.pref_definition_id is not null) then
220 -- Get the top level parent ID
221 open c_top_level_node(l_top_node_id);
222 fetch c_top_level_node into l_top_node_id;
223 close c_top_level_node;
224 if (l_top_node_id <> p_rec.pref_hierarchy_id) then
225 p_rec.top_level_parent_id := l_top_node_id;
226 else
227 p_rec.top_level_parent_id := null;
228 end if;
229 -- Get the code for the node
230 open c_code(p_rec.pref_definition_id);
231 fetch c_code into l_code;
232 p_rec.code := l_code;
233 close c_code;
234 else
235 p_rec.top_level_parent_id := null;
236 p_rec.code := null;
237 end if;
238
239 if g_debug then
240 hr_utility.set_location(' Leaving:'||l_proc, 10);
241 end if;
242 End pre_update;
243 --
244 -- ----------------------------------------------------------------------------
245 -- |-----------------------------< post_update >------------------------------|
246 -- ----------------------------------------------------------------------------
247 -- {Start Of Comments}
248 --
249 -- Description:
250 -- This private procedure contains any processing which is required after the
251 -- update dml.
252 --
253 -- Prerequisites:
254 -- This is an internal procedure which is called from the upd procedure.
255 --
256 -- In Parameters:
257 -- A Pl/Sql record structure.
258 --
259 -- Post Success:
260 -- Processing continues.
261 --
262 -- Post Failure:
263 -- If an error has occurred, an error message and exception will be raised
264 -- but not handled.
265 --
266 -- Developer Implementation Notes:
267 -- Any post-processing required after the update dml is issued should be
268 -- coded within this procedure. It is important to note that any 3rd party
269 -- maintenance should be reviewed before placing in this procedure.
270 --
271 -- Access Status:
272 -- Internal Row Handler Use Only.
273 --
274 -- {End Of Comments}
275 -- ----------------------------------------------------------------------------
276 Procedure post_update
277 (p_effective_date in date
278 ,p_rec in hxc_hph_shd.g_rec_type
279 ) is
280 --
281 l_proc varchar2(72) ;
282
283 --
284 Begin
285 if g_debug then
286 l_proc:= g_package||'post_update';
287 hr_utility.set_location('Entering:'||l_proc, 5);
288 end if;
289 begin
290 --
291 hxc_hph_rku.after_update
292 (p_effective_date => p_effective_date
293 ,p_pref_hierarchy_id
294 => p_rec.pref_hierarchy_id
295 ,p_type
296 => p_rec.type
297 ,p_name
298 => p_rec.name
299 ,p_business_group_id => p_rec.business_group_id
300 ,p_legislation_code => p_rec.legislation_code
301 ,p_parent_pref_hierarchy_id
302 => p_rec.parent_pref_hierarchy_id
303 ,p_edit_allowed
304 => p_rec.edit_allowed
305 ,p_displayed
306 => p_rec.displayed
307 ,p_pref_definition_id
308 => p_rec.pref_definition_id
309 ,p_attribute_category
310 => p_rec.attribute_category
311 ,p_attribute1
312 => p_rec.attribute1
313 ,p_attribute2
314 => p_rec.attribute2
315 ,p_attribute3
316 => p_rec.attribute3
317 ,p_attribute4
318 => p_rec.attribute4
319 ,p_attribute5
320 => p_rec.attribute5
321 ,p_attribute6
322 => p_rec.attribute6
323 ,p_attribute7
324 => p_rec.attribute7
325 ,p_attribute8
326 => p_rec.attribute8
327 ,p_attribute9
328 => p_rec.attribute9
329 ,p_attribute10
330 => p_rec.attribute10
331 ,p_attribute11
332 => p_rec.attribute11
333 ,p_attribute12
334 => p_rec.attribute12
335 ,p_attribute13
336 => p_rec.attribute13
337 ,p_attribute14
338 => p_rec.attribute14
339 ,p_attribute15
340 => p_rec.attribute15
341 ,p_attribute16
342 => p_rec.attribute16
343 ,p_attribute17
344 => p_rec.attribute17
345 ,p_attribute18
346 => p_rec.attribute18
347 ,p_attribute19
348 => p_rec.attribute19
349 ,p_attribute20
350 => p_rec.attribute20
351 ,p_attribute21
352 => p_rec.attribute21
353 ,p_attribute22
354 => p_rec.attribute22
355 ,p_attribute23
356 => p_rec.attribute23
357 ,p_attribute24
358 => p_rec.attribute24
359 ,p_attribute25
360 => p_rec.attribute25
361 ,p_attribute26
362 => p_rec.attribute26
363 ,p_attribute27
364 => p_rec.attribute27
365 ,p_attribute28
366 => p_rec.attribute28
367 ,p_attribute29
368 => p_rec.attribute29
369 ,p_attribute30
370 => p_rec.attribute30
371 ,p_object_version_number
372 => p_rec.object_version_number
373 ,p_orig_pref_hierarchy_id
374 => p_rec.orig_pref_hierarchy_id
375 ,p_orig_parent_hierarchy_id
376 => p_rec.orig_parent_hierarchy_id
377 ,p_top_level_parent_id --Performance Fix
378 => p_rec.top_level_parent_id
379 ,p_code
380 => p_rec.code
381 ,p_type_o
382 => hxc_hph_shd.g_old_rec.type
383 ,p_name_o
384 => hxc_hph_shd.g_old_rec.name
385 ,p_business_group_id_o => hxc_ter_shd.g_old_rec.business_group_id
386 ,p_legislation_code_o => hxc_ter_shd.g_old_rec.legislation_code
387 ,p_parent_pref_hierarchy_id_o
388 => hxc_hph_shd.g_old_rec.parent_pref_hierarchy_id
389 ,p_edit_allowed_o
390 => hxc_hph_shd.g_old_rec.edit_allowed
391 ,p_displayed_o
392 => hxc_hph_shd.g_old_rec.displayed
393 ,p_pref_definition_id_o
394 => hxc_hph_shd.g_old_rec.pref_definition_id
395 ,p_attribute_category_o
396 => hxc_hph_shd.g_old_rec.attribute_category
397 ,p_attribute1_o
398 => hxc_hph_shd.g_old_rec.attribute1
399 ,p_attribute2_o
400 => hxc_hph_shd.g_old_rec.attribute2
401 ,p_attribute3_o
402 => hxc_hph_shd.g_old_rec.attribute3
403 ,p_attribute4_o
404 => hxc_hph_shd.g_old_rec.attribute4
405 ,p_attribute5_o
406 => hxc_hph_shd.g_old_rec.attribute5
407 ,p_attribute6_o
408 => hxc_hph_shd.g_old_rec.attribute6
409 ,p_attribute7_o
410 => hxc_hph_shd.g_old_rec.attribute7
411 ,p_attribute8_o
412 => hxc_hph_shd.g_old_rec.attribute8
413 ,p_attribute9_o
414 => hxc_hph_shd.g_old_rec.attribute9
415 ,p_attribute10_o
416 => hxc_hph_shd.g_old_rec.attribute10
417 ,p_attribute11_o
418 => hxc_hph_shd.g_old_rec.attribute11
419 ,p_attribute12_o
420 => hxc_hph_shd.g_old_rec.attribute12
421 ,p_attribute13_o
422 => hxc_hph_shd.g_old_rec.attribute13
423 ,p_attribute14_o
424 => hxc_hph_shd.g_old_rec.attribute14
425 ,p_attribute15_o
426 => hxc_hph_shd.g_old_rec.attribute15
427 ,p_attribute16_o
428 => hxc_hph_shd.g_old_rec.attribute16
429 ,p_attribute17_o
430 => hxc_hph_shd.g_old_rec.attribute17
431 ,p_attribute18_o
432 => hxc_hph_shd.g_old_rec.attribute18
433 ,p_attribute19_o
434 => hxc_hph_shd.g_old_rec.attribute19
435 ,p_attribute20_o
436 => hxc_hph_shd.g_old_rec.attribute20
437 ,p_attribute21_o
438 => hxc_hph_shd.g_old_rec.attribute21
439 ,p_attribute22_o
440 => hxc_hph_shd.g_old_rec.attribute22
441 ,p_attribute23_o
442 => hxc_hph_shd.g_old_rec.attribute23
443 ,p_attribute24_o
444 => hxc_hph_shd.g_old_rec.attribute24
445 ,p_attribute25_o
446 => hxc_hph_shd.g_old_rec.attribute25
447 ,p_attribute26_o
448 => hxc_hph_shd.g_old_rec.attribute26
449 ,p_attribute27_o
450 => hxc_hph_shd.g_old_rec.attribute27
451 ,p_attribute28_o
452 => hxc_hph_shd.g_old_rec.attribute28
453 ,p_attribute29_o
454 => hxc_hph_shd.g_old_rec.attribute29
455 ,p_attribute30_o
456 => hxc_hph_shd.g_old_rec.attribute30
457 ,p_object_version_number_o
458 => hxc_hph_shd.g_old_rec.object_version_number
459 ,p_orig_pref_hierarchy_id_o
460 => hxc_hph_shd.g_old_rec.orig_pref_hierarchy_id
461 ,p_orig_parent_hierarchy_id_o
462 => hxc_hph_shd.g_old_rec.orig_parent_hierarchy_id
463 ,p_top_level_parent_id_o --Performance Fix
464 => hxc_hph_shd.g_old_rec.top_level_parent_id
465 ,p_code_o
466 => hxc_hph_shd.g_old_rec.code
467 );
468 --
469 exception
470 --
471 when hr_api.cannot_find_prog_unit then
472 --
473 hr_api.cannot_find_prog_unit_error
474 (p_module_name => 'HXC_PREF_HIERARCHIES'
475 ,p_hook_type => 'AU');
476 --
477 end;
478 --
479 if g_debug then
480 hr_utility.set_location(' Leaving:'||l_proc, 10);
481 end if;
482 End post_update;
483 --
484 -- ----------------------------------------------------------------------------
485 -- |-----------------------------< convert_defs >-----------------------------|
486 -- ----------------------------------------------------------------------------
487 -- {Start Of Comments}
488 --
489 -- Description:
490 -- The Convert_Defs procedure has one very important function:
491 -- It must return the record structure for the row with all system defaulted
492 -- values converted into its corresponding parameter value for update. When
493 -- we attempt to update a row through the Upd process , certain
494 -- parameters can be defaulted which enables flexibility in the calling of
495 -- the upd process (e.g. only attributes which need to be updated need to be
496 -- specified). For the upd process to determine which attributes
497 -- have NOT been specified we need to check if the parameter has a reserved
498 -- system default value. Therefore, for all parameters which have a
499 -- corresponding reserved system default mechanism specified we need to
500 -- check if a system default is being used. If a system default is being
501 -- used then we convert the defaulted value into its corresponding attribute
502 -- value held in the g_old_rec data structure.
503 --
504 -- Prerequisites:
505 -- This private function can only be called from the upd process.
506 --
507 -- In Parameters:
508 -- A Pl/Sql record structure.
509 --
510 -- Post Success:
511 -- The record structure will be returned with all system defaulted parameter
512 -- values converted into its current row attribute value.
513 --
514 -- Post Failure:
515 -- No direct error handling is required within this function. Any possible
516 -- errors within this procedure will be a PL/SQL value error due to
517 -- conversion of datatypes or data lengths.
518 --
519 -- Developer Implementation Notes:
520 -- None.
521 --
522 -- Access Status:
523 -- Internal Row Handler Use Only.
524 --
525 -- {End Of Comments}
526 -- ----------------------------------------------------------------------------
527 Procedure convert_defs
528 (p_rec in out nocopy hxc_hph_shd.g_rec_type
529 ) is
530 --
531 Begin
532 --
533 -- We must now examine each argument value in the
534 -- p_rec plsql record structure
535 -- to see if a system default is being used. If a system default
536 -- is being used then we must set to the 'current' argument value.
537 --
538 If (p_rec.type = hr_api.g_varchar2) then
539 p_rec.type :=
540 hxc_hph_shd.g_old_rec.type;
541 End If;
542 If (p_rec.name = hr_api.g_varchar2) then
543 p_rec.name :=
544 hxc_hph_shd.g_old_rec.name;
545 End If;
546 If (p_rec.business_group_id = hr_api.g_number) then
547 p_rec.business_group_id :=
548 hxc_ter_shd.g_old_rec.business_group_id;
549 End If;
550 If (p_rec.legislation_code = hr_api.g_varchar2) then
551 p_rec.legislation_code :=
552 hxc_ter_shd.g_old_rec.legislation_code;
553 End If;
554 If (p_rec.parent_pref_hierarchy_id = hr_api.g_number) then
555 p_rec.parent_pref_hierarchy_id :=
556 hxc_hph_shd.g_old_rec.parent_pref_hierarchy_id;
557 End If;
558 If (p_rec.edit_allowed = hr_api.g_varchar2) then
559 p_rec.edit_allowed :=
560 hxc_hph_shd.g_old_rec.edit_allowed;
561 End If;
562 If (p_rec.displayed = hr_api.g_varchar2) then
563 p_rec.displayed :=
564 hxc_hph_shd.g_old_rec.displayed;
565 End If;
566 If (p_rec.pref_definition_id = hr_api.g_number) then
567 p_rec.pref_definition_id :=
568 hxc_hph_shd.g_old_rec.pref_definition_id;
569 End If;
570 If (p_rec.attribute_category = hr_api.g_varchar2) then
571 p_rec.attribute_category :=
572 hxc_hph_shd.g_old_rec.attribute_category;
573 End If;
574 If (p_rec.attribute1 = hr_api.g_varchar2) then
575 p_rec.attribute1 :=
576 hxc_hph_shd.g_old_rec.attribute1;
577 End If;
578 If (p_rec.attribute2 = hr_api.g_varchar2) then
579 p_rec.attribute2 :=
580 hxc_hph_shd.g_old_rec.attribute2;
581 End If;
582 If (p_rec.attribute3 = hr_api.g_varchar2) then
583 p_rec.attribute3 :=
584 hxc_hph_shd.g_old_rec.attribute3;
585 End If;
586 If (p_rec.attribute4 = hr_api.g_varchar2) then
587 p_rec.attribute4 :=
588 hxc_hph_shd.g_old_rec.attribute4;
589 End If;
590 If (p_rec.attribute5 = hr_api.g_varchar2) then
591 p_rec.attribute5 :=
592 hxc_hph_shd.g_old_rec.attribute5;
593 End If;
594 If (p_rec.attribute6 = hr_api.g_varchar2) then
595 p_rec.attribute6 :=
596 hxc_hph_shd.g_old_rec.attribute6;
597 End If;
598 If (p_rec.attribute7 = hr_api.g_varchar2) then
599 p_rec.attribute7 :=
600 hxc_hph_shd.g_old_rec.attribute7;
601 End If;
602 If (p_rec.attribute8 = hr_api.g_varchar2) then
603 p_rec.attribute8 :=
604 hxc_hph_shd.g_old_rec.attribute8;
605 End If;
606 If (p_rec.attribute9 = hr_api.g_varchar2) then
607 p_rec.attribute9 :=
608 hxc_hph_shd.g_old_rec.attribute9;
609 End If;
610 If (p_rec.attribute10 = hr_api.g_varchar2) then
611 p_rec.attribute10 :=
612 hxc_hph_shd.g_old_rec.attribute10;
613 End If;
614 If (p_rec.attribute11 = hr_api.g_varchar2) then
615 p_rec.attribute11 :=
616 hxc_hph_shd.g_old_rec.attribute11;
617 End If;
618 If (p_rec.attribute12 = hr_api.g_varchar2) then
619 p_rec.attribute12 :=
620 hxc_hph_shd.g_old_rec.attribute12;
621 End If;
622 If (p_rec.attribute13 = hr_api.g_varchar2) then
623 p_rec.attribute13 :=
624 hxc_hph_shd.g_old_rec.attribute13;
625 End If;
626 If (p_rec.attribute14 = hr_api.g_varchar2) then
627 p_rec.attribute14 :=
628 hxc_hph_shd.g_old_rec.attribute14;
629 End If;
630 If (p_rec.attribute15 = hr_api.g_varchar2) then
631 p_rec.attribute15 :=
632 hxc_hph_shd.g_old_rec.attribute15;
633 End If;
634 If (p_rec.attribute16 = hr_api.g_varchar2) then
635 p_rec.attribute16 :=
636 hxc_hph_shd.g_old_rec.attribute16;
637 End If;
638 If (p_rec.attribute17 = hr_api.g_varchar2) then
639 p_rec.attribute17 :=
640 hxc_hph_shd.g_old_rec.attribute17;
641 End If;
642 If (p_rec.attribute18 = hr_api.g_varchar2) then
643 p_rec.attribute18 :=
644 hxc_hph_shd.g_old_rec.attribute18;
645 End If;
646 If (p_rec.attribute19 = hr_api.g_varchar2) then
647 p_rec.attribute19 :=
648 hxc_hph_shd.g_old_rec.attribute19;
649 End If;
650 If (p_rec.attribute20 = hr_api.g_varchar2) then
651 p_rec.attribute20 :=
652 hxc_hph_shd.g_old_rec.attribute20;
653 End If;
654 If (p_rec.attribute21 = hr_api.g_varchar2) then
655 p_rec.attribute21 :=
656 hxc_hph_shd.g_old_rec.attribute21;
657 End If;
658 If (p_rec.attribute22 = hr_api.g_varchar2) then
659 p_rec.attribute22 :=
660 hxc_hph_shd.g_old_rec.attribute22;
661 End If;
662 If (p_rec.attribute23 = hr_api.g_varchar2) then
663 p_rec.attribute23 :=
664 hxc_hph_shd.g_old_rec.attribute23;
665 End If;
666 If (p_rec.attribute24 = hr_api.g_varchar2) then
667 p_rec.attribute24 :=
668 hxc_hph_shd.g_old_rec.attribute24;
669 End If;
670 If (p_rec.attribute25 = hr_api.g_varchar2) then
671 p_rec.attribute25 :=
672 hxc_hph_shd.g_old_rec.attribute25;
673 End If;
674 If (p_rec.attribute26 = hr_api.g_varchar2) then
675 p_rec.attribute26 :=
676 hxc_hph_shd.g_old_rec.attribute26;
677 End If;
678 If (p_rec.attribute27 = hr_api.g_varchar2) then
679 p_rec.attribute27 :=
680 hxc_hph_shd.g_old_rec.attribute27;
681 End If;
682 If (p_rec.attribute28 = hr_api.g_varchar2) then
683 p_rec.attribute28 :=
684 hxc_hph_shd.g_old_rec.attribute28;
685 End If;
686 If (p_rec.attribute29 = hr_api.g_varchar2) then
687 p_rec.attribute29 :=
688 hxc_hph_shd.g_old_rec.attribute29;
689 End If;
690 If (p_rec.attribute30 = hr_api.g_varchar2) then
691 p_rec.attribute30 :=
692 hxc_hph_shd.g_old_rec.attribute30;
693 End If;
694 If (p_rec.orig_pref_hierarchy_id = hr_api.g_number) then
695 p_rec.orig_pref_hierarchy_id :=
696 hxc_hph_shd.g_old_rec.orig_pref_hierarchy_id;
697 End If;
698 If (p_rec.orig_parent_hierarchy_id = hr_api.g_number) then
699 p_rec.orig_parent_hierarchy_id :=
700 hxc_hph_shd.g_old_rec.orig_parent_hierarchy_id;
701 End If;
702 If (p_rec.top_level_parent_id = hr_api.g_number) then -- Performance Fix
703 p_rec.top_level_parent_id :=
704 hxc_hph_shd.g_old_rec.top_level_parent_id;
705 End If;
706 If (p_rec.code = hr_api.g_varchar2) then
707 p_rec.code :=
708 hxc_hph_shd.g_old_rec.code;
709 End If;
710 --
711 End convert_defs;
712 --
713 -- ----------------------------------------------------------------------------
714 -- |---------------------------------< upd >----------------------------------|
715 -- ----------------------------------------------------------------------------
716 Procedure upd
717 (p_effective_date in date
718 ,p_rec in out nocopy hxc_hph_shd.g_rec_type
719 ) is
720 --
721 l_proc varchar2(72);
722 --
723 Begin
724 g_debug:=hr_utility.debug_enabled;
725 if g_debug then
726 l_proc := g_package||'upd';
727 hr_utility.set_location('Entering:'||l_proc, 5);
728 end if;
729 --
730 -- We must lock the row which we need to update.
731 --
732 hxc_hph_shd.lck
733 (p_rec.pref_hierarchy_id
734 ,p_rec.object_version_number
735 );
736 --
737 -- 1. During an update system defaults are used to determine if
738 -- arguments have been defaulted or not. We must therefore
739 -- derive the full record structure values to be updated.
740 --
741 -- 2. Call the supporting update validate operations.
742 --
743 convert_defs(p_rec);
744 hxc_hph_bus.update_validate
745 (p_effective_date
746 ,p_rec
747 );
748 --
749 -- Call the supporting pre-update operation
750 --
751 hxc_hph_upd.pre_update(p_rec);
752 --
753 -- Update the row.
754 --
755 hxc_hph_upd.update_dml(p_rec);
756 --
757 -- Call the supporting post-update operation
758 --
759 hxc_hph_upd.post_update
760 (p_effective_date
761 ,p_rec
762 );
763 End upd;
764 --
765 -- ----------------------------------------------------------------------------
766 -- |---------------------------------< upd >----------------------------------|
767 -- ----------------------------------------------------------------------------
768 Procedure upd
769 (p_effective_date in date
770 ,p_pref_hierarchy_id in number
771 ,p_object_version_number in out nocopy number
772 ,p_name in varchar2 default hr_api.g_varchar2
773 ,p_business_group_id in number default hr_api.g_number
774 ,p_legislation_code in varchar2 default hr_api.g_varchar2
775 ,p_edit_allowed in varchar2 default hr_api.g_varchar2
776 ,p_displayed in varchar2 default hr_api.g_varchar2
777 ,p_type in varchar2 default hr_api.g_varchar2
778 ,p_parent_pref_hierarchy_id in number default hr_api.g_number
779 ,p_pref_definition_id in number default hr_api.g_number
780 ,p_attribute_category in varchar2 default hr_api.g_varchar2
781 ,p_attribute1 in varchar2 default hr_api.g_varchar2
782 ,p_attribute2 in varchar2 default hr_api.g_varchar2
783 ,p_attribute3 in varchar2 default hr_api.g_varchar2
784 ,p_attribute4 in varchar2 default hr_api.g_varchar2
785 ,p_attribute5 in varchar2 default hr_api.g_varchar2
786 ,p_attribute6 in varchar2 default hr_api.g_varchar2
787 ,p_attribute7 in varchar2 default hr_api.g_varchar2
788 ,p_attribute8 in varchar2 default hr_api.g_varchar2
789 ,p_attribute9 in varchar2 default hr_api.g_varchar2
790 ,p_attribute10 in varchar2 default hr_api.g_varchar2
791 ,p_attribute11 in varchar2 default hr_api.g_varchar2
792 ,p_attribute12 in varchar2 default hr_api.g_varchar2
793 ,p_attribute13 in varchar2 default hr_api.g_varchar2
794 ,p_attribute14 in varchar2 default hr_api.g_varchar2
795 ,p_attribute15 in varchar2 default hr_api.g_varchar2
796 ,p_attribute16 in varchar2 default hr_api.g_varchar2
797 ,p_attribute17 in varchar2 default hr_api.g_varchar2
798 ,p_attribute18 in varchar2 default hr_api.g_varchar2
799 ,p_attribute19 in varchar2 default hr_api.g_varchar2
800 ,p_attribute20 in varchar2 default hr_api.g_varchar2
801 ,p_attribute21 in varchar2 default hr_api.g_varchar2
802 ,p_attribute22 in varchar2 default hr_api.g_varchar2
803 ,p_attribute23 in varchar2 default hr_api.g_varchar2
804 ,p_attribute24 in varchar2 default hr_api.g_varchar2
805 ,p_attribute25 in varchar2 default hr_api.g_varchar2
806 ,p_attribute26 in varchar2 default hr_api.g_varchar2
807 ,p_attribute27 in varchar2 default hr_api.g_varchar2
808 ,p_attribute28 in varchar2 default hr_api.g_varchar2
809 ,p_attribute29 in varchar2 default hr_api.g_varchar2
810 ,p_attribute30 in varchar2 default hr_api.g_varchar2
811 ,p_orig_pref_hierarchy_id in number default hr_api.g_number
812 ,p_orig_parent_hierarchy_id in number default hr_api.g_number
813 ,p_top_level_parent_id in number default hr_api.g_number --Performance Fix
814 ,p_code in varchar2 default hr_api.g_varchar2
815 ) is
816 --
817 l_rec hxc_hph_shd.g_rec_type;
818 l_proc varchar2(72);
819 --
820 Begin
821 g_debug:=hr_utility.debug_enabled;
822 if g_debug then
823 l_proc := g_package||'upd';
824 hr_utility.set_location('Entering:'||l_proc, 5);
825 end if;
826 --
827 -- Call conversion function to turn arguments into the
828 -- l_rec structure.
829 --
830 l_rec :=
831 hxc_hph_shd.convert_args
832 (p_pref_hierarchy_id
833 ,p_type
834 ,p_name
835 ,p_business_group_id
836 ,p_legislation_code
837 ,p_parent_pref_hierarchy_id
838 ,p_edit_allowed
839 ,p_displayed
840 ,p_pref_definition_id
841 ,p_attribute_category
842 ,p_attribute1
843 ,p_attribute2
844 ,p_attribute3
845 ,p_attribute4
846 ,p_attribute5
847 ,p_attribute6
848 ,p_attribute7
849 ,p_attribute8
850 ,p_attribute9
851 ,p_attribute10
852 ,p_attribute11
853 ,p_attribute12
854 ,p_attribute13
855 ,p_attribute14
856 ,p_attribute15
857 ,p_attribute16
858 ,p_attribute17
859 ,p_attribute18
860 ,p_attribute19
861 ,p_attribute20
862 ,p_attribute21
863 ,p_attribute22
864 ,p_attribute23
865 ,p_attribute24
866 ,p_attribute25
867 ,p_attribute26
868 ,p_attribute27
869 ,p_attribute28
870 ,p_attribute29
871 ,p_attribute30
872 ,p_object_version_number
873 ,p_orig_pref_hierarchy_id
874 ,p_orig_parent_hierarchy_id
875 ,p_top_level_parent_id --Performance Fix
876 ,p_code
877 );
878 --
879 -- Having converted the arguments into the
880 -- plsql record structure we call the corresponding record
881 -- business process.
882 --
883 hxc_hph_upd.upd
884 (p_effective_date
885 ,l_rec
886 );
887 p_object_version_number := l_rec.object_version_number;
888 --
889 if g_debug then
890 hr_utility.set_location(' Leaving:'||l_proc, 10);
891 end if;
892 End upd;
893 --
894 end hxc_hph_upd;