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