1 Package Body pay_prt_upd as
2 /* $Header: pyprtrhi.pkb 115.13 2003/02/28 15:52:21 alogue noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pay_prt_upd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_update_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the execution of dml from the datetrack mode
17 -- of CORRECTION only. It is important to note that the object version
18 -- number is only increment by 1 because the datetrack correction is
19 -- soley for one datetracked row.
20 -- This procedure controls the actual dml update logic. The functions of this
21 -- procedure are as follows:
22 -- 1) Get the next object_version_number.
23 -- 2) To set and unset the g_api_dml status as required (as we are about to
24 -- perform dml).
25 -- 3) To update the specified row in the schema using the primary key in
26 -- the predicates.
27 -- 4) To trap any constraint violations that may have occurred.
28 -- 5) To raise any other errors.
29 --
30 -- Prerequisites:
31 -- This is an internal private procedure which must be called from the
32 -- update_dml procedure.
33 --
34 -- In Parameters:
35 -- A Pl/Sql record structure.
36 --
37 -- Post Success:
38 -- The specified row will be updated in the schema.
39 --
40 -- Post Failure:
41 -- On the update dml failure it is important to note that we always reset the
42 -- g_api_dml status to false.
43 -- If a check or unique integrity constraint violation is raised the
44 -- constraint_error procedure will be called.
45 -- If any other error is reported, the error will be raised after the
46 -- g_api_dml status is reset.
47 --
48 -- Developer Implementation Notes:
49 -- The update 'set' arguments list should be modified if any of your
50 -- attributes are not updateable.
51 --
52 -- Access Status:
53 -- Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 Procedure dt_update_dml
58 (p_rec in out nocopy pay_prt_shd.g_rec_type
59 ,p_effective_date in date
60 ,p_datetrack_mode in varchar2
61 ,p_validation_start_date in date
62 ,p_validation_end_date in date
63 ) is
64 --
65 l_proc varchar2(72) := g_package||'dt_update_dml';
66 --
67 Begin
68 hr_utility.set_location('Entering:'||l_proc, 5);
69 --
70 If (p_datetrack_mode = hr_api.g_correction) then
71 hr_utility.set_location(l_proc, 10);
72 --
73 -- Because we are updating a row we must get the next object
74 -- version number.
75 --
76 p_rec.object_version_number :=
77 dt_api.get_object_version_number
78 (p_base_table_name => 'pay_run_types_f'
79 ,p_base_key_column => 'run_type_id'
80 ,p_base_key_value => p_rec.run_type_id
81 );
82 --
83 -- Update the pay_run_types_f Row
84 --
85 update pay_run_types_f
86 set
87 run_type_id = p_rec.run_type_id
88 ,run_type_name = p_rec.run_type_name
89 ,run_method = p_rec.run_method
90 ,business_group_id = p_rec.business_group_id
91 ,legislation_code = p_rec.legislation_code
92 ,shortname = p_rec.shortname
93 ,srs_flag = p_rec.srs_flag
94 ,run_information_category = p_rec.run_information_category
95 ,run_information1 = p_rec.run_information1
96 ,run_information2 = p_rec.run_information2
97 ,run_information3 = p_rec.run_information3
98 ,run_information4 = p_rec.run_information4
99 ,run_information5 = p_rec.run_information5
100 ,run_information6 = p_rec.run_information6
101 ,run_information7 = p_rec.run_information7
102 ,run_information8 = p_rec.run_information8
103 ,run_information9 = p_rec.run_information9
104 ,run_information10 = p_rec.run_information10
105 ,run_information11 = p_rec.run_information11
106 ,run_information12 = p_rec.run_information12
107 ,run_information13 = p_rec.run_information13
108 ,run_information14 = p_rec.run_information14
109 ,run_information15 = p_rec.run_information15
110 ,run_information16 = p_rec.run_information16
111 ,run_information17 = p_rec.run_information17
112 ,run_information18 = p_rec.run_information18
113 ,run_information19 = p_rec.run_information19
114 ,run_information20 = p_rec.run_information20
115 ,run_information21 = p_rec.run_information21
116 ,run_information22 = p_rec.run_information22
117 ,run_information23 = p_rec.run_information23
118 ,run_information24 = p_rec.run_information24
119 ,run_information25 = p_rec.run_information25
120 ,run_information26 = p_rec.run_information26
121 ,run_information27 = p_rec.run_information27
122 ,run_information28 = p_rec.run_information28
123 ,run_information29 = p_rec.run_information29
124 ,run_information30 = p_rec.run_information30
125 ,object_version_number = p_rec.object_version_number
126 where run_type_id = p_rec.run_type_id
127 and effective_start_date = p_validation_start_date
128 and effective_end_date = p_validation_end_date;
129 --
130 --
131 -- Set the effective start and end dates
132 --
133 p_rec.effective_start_date := p_validation_start_date;
134 p_rec.effective_end_date := p_validation_end_date;
135 End If;
136 --
137 hr_utility.set_location(' Leaving:'||l_proc, 15);
138 Exception
139 When hr_api.check_integrity_violated Then
140 -- A check constraint has been violated
141 --
142 pay_prt_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 pay_prt_shd.constraint_error
148 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
149 When Others Then
150 --
151 Raise;
152 End dt_update_dml;
153 --
154 -- ----------------------------------------------------------------------------
155 -- |------------------------------< update_dml >------------------------------|
156 -- ----------------------------------------------------------------------------
157 -- {Start Of Comments}
158 --
159 -- Description:
160 -- This procedure calls the dt_update_dml control logic which handles
161 -- the actual datetrack dml.
162 --
163 -- Prerequisites:
164 -- This is an internal private procedure which must be called from the upd
165 -- procedure.
166 --
167 -- In Parameters:
168 -- A Pl/Sql record structre.
169 --
170 -- Post Success:
171 -- Processing contines.
172 --
173 -- Post Failure:
174 -- No specific error handling is required within this procedure.
175 --
176 -- Developer Implementation Notes:
177 -- The update 'set' arguments list should be modified if any of your
178 -- attributes are not updateable.
179 --
180 -- Access Status:
181 -- Internal Row Handler Use Only.
182 --
183 -- {End Of Comments}
184 -- ----------------------------------------------------------------------------
185 Procedure update_dml
186 (p_rec in out nocopy pay_prt_shd.g_rec_type
187 ,p_effective_date in date
188 ,p_datetrack_mode in varchar2
189 ,p_validation_start_date in date
190 ,p_validation_end_date in date
191 ) is
192 --
193 l_proc varchar2(72) := g_package||'update_dml';
194 --
195 Begin
196 hr_utility.set_location('Entering:'||l_proc, 5);
197 --
198 pay_prt_upd.dt_update_dml
199 (p_rec => p_rec
200 ,p_effective_date => p_effective_date
201 ,p_datetrack_mode => p_datetrack_mode
202 ,p_validation_start_date => p_validation_start_date
203 ,p_validation_end_date => p_validation_end_date
204 );
205 --
206 hr_utility.set_location(' Leaving:'||l_proc, 10);
207 End update_dml;
208 --
209 -- ----------------------------------------------------------------------------
210 -- |----------------------------< dt_pre_update >-----------------------------|
211 -- ----------------------------------------------------------------------------
212 -- {Start Of Comments}
213 --
214 -- Description:
215 -- The dt_pre_update procedure controls the execution
216 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
217 -- and UPDATE_CHANGE_INSERT only. The execution required is as
218 -- follows:
219 --
220 -- 1) Providing the datetrack update mode is not 'CORRECTION'
221 -- then set the effective end date of the current row (this
222 -- will be the validation_start_date - 1).
223 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
224 -- corresponding delete_dml process to delete any future rows
225 -- where the effective_start_date is greater than or equal to
226 -- the validation_start_date.
227 -- 3) Call the insert_dml process to insert the new updated row
228 -- details.
229 --
230 -- Prerequisites:
231 -- This is an internal procedure which is called from the
232 -- pre_update procedure.
233 --
234 -- In Parameters:
235 --
236 -- Post Success:
237 -- Processing continues.
238 --
239 -- Post Failure:
240 -- If an error has occurred, an error message and exception will be raised
241 -- but not handled.
242 --
243 -- Developer Implementation Notes:
244 -- This is an internal procedure which is required by Datetrack. Don't
245 -- remove or modify.
246 --
247 -- Access Status:
248 -- Internal Row Handler Use Only.
249 --
250 -- {End Of Comments}
251 -- ----------------------------------------------------------------------------
252 Procedure dt_pre_update
253 (p_rec in out nocopy pay_prt_shd.g_rec_type
254 ,p_effective_date in date
255 ,p_datetrack_mode in varchar2
256 ,p_validation_start_date in date
257 ,p_validation_end_date in date
258 ) is
259 --
260 l_proc varchar2(72) := g_package||'dt_pre_update';
261 l_dummy_version_number number;
262 --
263 Begin
264 hr_utility.set_location('Entering:'||l_proc, 5);
265 If (p_datetrack_mode <> hr_api.g_correction) then
266 --
267 -- Update the current effective end date
268 --
269 pay_prt_shd.upd_effective_end_date
270 (p_effective_date => p_effective_date
271 ,p_base_key_value => p_rec.run_type_id
272 ,p_new_effective_end_date => (p_validation_start_date - 1)
273 ,p_validation_start_date => p_validation_start_date
274 ,p_validation_end_date => p_validation_end_date
275 ,p_object_version_number => l_dummy_version_number
276 );
277 --
278 If (p_datetrack_mode = hr_api.g_update_override) then
279 --
280 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
281 -- delete any future rows
282 --
283 pay_prt_del.delete_dml
284 (p_rec => p_rec
285 ,p_effective_date => p_effective_date
286 ,p_datetrack_mode => p_datetrack_mode
287 ,p_validation_start_date => p_validation_start_date
288 ,p_validation_end_date => p_validation_end_date
289 );
290 End If;
291 --
292 -- We must now insert the updated row
293 --
294 pay_prt_ins.insert_dml
295 (p_rec => p_rec
296 ,p_effective_date => p_effective_date
297 ,p_datetrack_mode => p_datetrack_mode
298 ,p_validation_start_date => p_validation_start_date
299 ,p_validation_end_date => p_validation_end_date
300 );
301 End If;
302 hr_utility.set_location(' Leaving:'||l_proc, 20);
303 End dt_pre_update;
304 --
305 -- ----------------------------------------------------------------------------
306 -- |------------------------------< pre_update >------------------------------|
307 -- ----------------------------------------------------------------------------
308 -- {Start Of Comments}
309 --
310 -- Description:
311 -- This private procedure contains any processing which is required before
312 -- the update dml.
313 --
314 -- Prerequisites:
315 -- This is an internal procedure which is called from the upd procedure.
316 --
317 -- In Parameters:
318 -- A Pl/Sql record structure.
319 --
320 -- Post Success:
321 -- Processing continues.
322 --
323 -- Post Failure:
324 -- If an error has occurred, an error message and exception will be raised
325 -- but not handled.
326 --
327 -- Developer Implementation Notes:
328 -- Any pre-processing required before the update dml is issued should be
329 -- coded within this procedure. It is important to note that any 3rd party
330 -- maintenance should be reviewed before placing in this procedure. The call
331 -- to the dt_update_dml procedure should NOT be removed.
332 --
333 -- Access Status:
334 -- Internal Row Handler Use Only.
335 --
336 -- {End Of Comments}
337 -- ----------------------------------------------------------------------------
338 Procedure pre_update
339 (p_rec in out nocopy pay_prt_shd.g_rec_type
340 ,p_effective_date in date
341 ,p_datetrack_mode in varchar2
342 ,p_validation_start_date in date
343 ,p_validation_end_date in date
344 ) is
345 --
346 l_proc varchar2(72) := g_package||'pre_update';
347 --
348 Begin
349 hr_utility.set_location('Entering:'||l_proc, 5);
350 --
351 --
352 --
353 dt_pre_update
354 (p_rec => p_rec
355 ,p_effective_date => p_effective_date
356 ,p_datetrack_mode => p_datetrack_mode
357 ,p_validation_start_date => p_validation_start_date
358 ,p_validation_end_date => p_validation_end_date
359 );
360 --
361 hr_utility.set_location(' Leaving:'||l_proc, 10);
362 End pre_update;
363 --
364 -- ----------------------------------------------------------------------------
365 -- |----------------------------< post_update >-------------------------------|
366 -- ----------------------------------------------------------------------------
367 -- {Start Of Comments}
368 --
369 -- Description:
370 -- This private procedure contains any processing which is required after the
371 -- update dml.
372 --
373 -- Prerequisites:
374 -- This is an internal procedure which is called from the upd procedure.
375 --
376 -- In Parameters:
377 -- A Pl/Sql record structure.
378 --
379 -- Post Success:
380 -- Processing continues.
381 --
382 -- Post Failure:
383 -- If an error has occurred, an error message and exception will be raised
384 -- but not handled.
385 --
386 -- Developer Implementation Notes:
387 -- Any post-processing required after the update dml is issued should be
388 -- coded within this procedure. It is important to note that any 3rd party
389 -- maintenance should be reviewed before placing in this procedure.
390 --
391 -- Access Status:
392 -- Internal Row Handler Use Only.
393 --
394 -- {End Of Comments}
395 -- ----------------------------------------------------------------------------
396 Procedure post_update
397 (p_rec in pay_prt_shd.g_rec_type
398 ,p_effective_date in date
399 ,p_datetrack_mode in varchar2
400 ,p_validation_start_date in date
401 ,p_validation_end_date in date
402 ) is
403 --
404 l_proc varchar2(72) := g_package||'post_update';
405 --
406 Begin
407 hr_utility.set_location('Entering:'||l_proc, 5);
408 begin
409 --
410 pay_prt_rku.after_update
411 (p_effective_date
412 => p_effective_date
413 ,p_datetrack_mode
414 => p_datetrack_mode
415 ,p_validation_start_date
416 => p_validation_start_date
417 ,p_validation_end_date
418 => p_validation_end_date
419 ,p_run_type_id
420 => p_rec.run_type_id
421 -- ,p_run_type_name
422 -- => p_rec.run_type_name
423 ,p_effective_start_date
424 => p_rec.effective_start_date
425 ,p_effective_end_date
426 => p_rec.effective_end_date
427 ,p_shortname
428 => p_rec.shortname
429 ,p_srs_flag
430 => p_rec.srs_flag
431 ,p_run_information_category
432 => p_rec.run_information_category
433 ,p_run_information1
434 => p_rec.run_information1
435 ,p_run_information2
436 => p_rec.run_information2
437 ,p_run_information3
438 => p_rec.run_information3
439 ,p_run_information4
440 => p_rec.run_information4
441 ,p_run_information5
442 => p_rec.run_information5
443 ,p_run_information6
444 => p_rec.run_information6
445 ,p_run_information7
446 => p_rec.run_information7
447 ,p_run_information8
448 => p_rec.run_information8
449 ,p_run_information9
450 => p_rec.run_information9
451 ,p_run_information10
452 => p_rec.run_information10
453 ,p_run_information11
454 => p_rec.run_information11
455 ,p_run_information12
456 => p_rec.run_information12
457 ,p_run_information13
458 => p_rec.run_information13
459 ,p_run_information14
460 => p_rec.run_information14
461 ,p_run_information15
462 => p_rec.run_information15
463 ,p_run_information16
464 => p_rec.run_information16
465 ,p_run_information17
466 => p_rec.run_information17
467 ,p_run_information18
468 => p_rec.run_information18
469 ,p_run_information19
470 => p_rec.run_information19
471 ,p_run_information20
472 => p_rec.run_information20
473 ,p_run_information21
474 => p_rec.run_information21
475 ,p_run_information22
476 => p_rec.run_information22
477 ,p_run_information23
478 => p_rec.run_information23
479 ,p_run_information24
480 => p_rec.run_information24
481 ,p_run_information25
482 => p_rec.run_information25
483 ,p_run_information26
484 => p_rec.run_information26
485 ,p_run_information27
486 => p_rec.run_information27
487 ,p_run_information28
488 => p_rec.run_information28
489 ,p_run_information29
490 => p_rec.run_information29
491 ,p_run_information30
492 => p_rec.run_information30
493 ,p_object_version_number
494 => p_rec.object_version_number
495 ,p_run_type_name_o
496 => pay_prt_shd.g_old_rec.run_type_name
497 ,p_run_method_o
498 => pay_prt_shd.g_old_rec.run_method
499 ,p_effective_start_date_o
500 => pay_prt_shd.g_old_rec.effective_start_date
501 ,p_effective_end_date_o
502 => pay_prt_shd.g_old_rec.effective_end_date
503 ,p_business_group_id_o
504 => pay_prt_shd.g_old_rec.business_group_id
505 ,p_legislation_code_o
506 => pay_prt_shd.g_old_rec.legislation_code
507 ,p_shortname_o
508 => pay_prt_shd.g_old_rec.shortname
509 ,p_srs_flag_o
510 => pay_prt_shd.g_old_rec.srs_flag
511 ,p_run_information_category_o
512 => pay_prt_shd.g_old_rec.run_information_category
513 ,p_run_information1_o
514 => pay_prt_shd.g_old_rec.run_information1
515 ,p_run_information2_o
516 => pay_prt_shd.g_old_rec.run_information2
517 ,p_run_information3_o
518 => pay_prt_shd.g_old_rec.run_information3
519 ,p_run_information4_o
520 => pay_prt_shd.g_old_rec.run_information4
521 ,p_run_information5_o
522 => pay_prt_shd.g_old_rec.run_information5
523 ,p_run_information6_o
524 => pay_prt_shd.g_old_rec.run_information6
525 ,p_run_information7_o
526 => pay_prt_shd.g_old_rec.run_information7
527 ,p_run_information8_o
528 => pay_prt_shd.g_old_rec.run_information8
529 ,p_run_information9_o
530 => pay_prt_shd.g_old_rec.run_information9
531 ,p_run_information10_o
532 => pay_prt_shd.g_old_rec.run_information10
533 ,p_run_information11_o
534 => pay_prt_shd.g_old_rec.run_information11
535 ,p_run_information12_o
536 => pay_prt_shd.g_old_rec.run_information12
537 ,p_run_information13_o
538 => pay_prt_shd.g_old_rec.run_information13
539 ,p_run_information14_o
540 => pay_prt_shd.g_old_rec.run_information14
541 ,p_run_information15_o
542 => pay_prt_shd.g_old_rec.run_information15
543 ,p_run_information16_o
544 => pay_prt_shd.g_old_rec.run_information16
545 ,p_run_information17_o
546 => pay_prt_shd.g_old_rec.run_information17
547 ,p_run_information18_o
548 => pay_prt_shd.g_old_rec.run_information18
549 ,p_run_information19_o
550 => pay_prt_shd.g_old_rec.run_information19
551 ,p_run_information20_o
552 => pay_prt_shd.g_old_rec.run_information20
553 ,p_run_information21_o
554 => pay_prt_shd.g_old_rec.run_information21
555 ,p_run_information22_o
556 => pay_prt_shd.g_old_rec.run_information22
557 ,p_run_information23_o
558 => pay_prt_shd.g_old_rec.run_information23
559 ,p_run_information24_o
560 => pay_prt_shd.g_old_rec.run_information24
561 ,p_run_information25_o
562 => pay_prt_shd.g_old_rec.run_information25
563 ,p_run_information26_o
564 => pay_prt_shd.g_old_rec.run_information26
565 ,p_run_information27_o
566 => pay_prt_shd.g_old_rec.run_information27
567 ,p_run_information28_o
568 => pay_prt_shd.g_old_rec.run_information28
569 ,p_run_information29_o
570 => pay_prt_shd.g_old_rec.run_information29
571 ,p_run_information30_o
572 => pay_prt_shd.g_old_rec.run_information30
573 ,p_object_version_number_o
574 => pay_prt_shd.g_old_rec.object_version_number
575 );
576 --
577 exception
578 --
579 when hr_api.cannot_find_prog_unit then
580 --
581 hr_api.cannot_find_prog_unit_error
582 (p_module_name => 'PAY_RUN_TYPES_F'
583 ,p_hook_type => 'AU');
584 --
585 end;
586 --
587 hr_utility.set_location(' Leaving:'||l_proc, 10);
588 End post_update;
589 --
590 -- ----------------------------------------------------------------------------
591 -- |-----------------------------< convert_defs >-----------------------------|
592 -- ----------------------------------------------------------------------------
593 -- {Start Of Comments}
594 --
595 -- Description:
596 -- The Convert_Defs procedure has one very important function:
597 -- It must return the record structure for the row with all system defaulted
598 -- values converted into its corresponding parameter value for update. When
599 -- we attempt to update a row through the Upd process , certain
600 -- parameters can be defaulted which enables flexibility in the calling of
601 -- the upd process (e.g. only attributes which need to be updated need to be
602 -- specified). For the upd process to determine which attributes
603 -- have NOT been specified we need to check if the parameter has a reserved
604 -- system default value. Therefore, for all parameters which have a
605 -- corresponding reserved system default mechanism specified we need to
606 -- check if a system default is being used. If a system default is being
607 -- used then we convert the defaulted value into its corresponding attribute
608 -- value held in the g_old_rec data structure.
609 --
610 -- Prerequisites:
611 -- This private function can only be called from the upd process.
612 --
613 -- In Parameters:
614 -- A Pl/Sql record structure.
615 --
616 -- Post Success:
617 -- The record structure will be returned with all system defaulted parameter
618 -- values converted into its current row attribute value.
619 --
620 -- Post Failure:
621 -- No direct error handling is required within this function. Any possible
622 -- errors within this procedure will be a PL/SQL value error due to
623 -- conversion of datatypes or data lengths.
624 --
625 -- Developer Implementation Notes:
626 -- None.
627 --
628 -- Access Status:
629 -- Internal Row Handler Use Only.
630 --
631 -- {End Of Comments}
632 -- ----------------------------------------------------------------------------
633 Procedure convert_defs
634 (p_rec in out nocopy pay_prt_shd.g_rec_type
635 ) is
636 --
637 Begin
638 --
639 -- We must now examine each argument value in the
640 -- p_rec plsql record structure
641 -- to see if a system default is being used. If a system default
642 -- is being used then we must set to the 'current' argument value.
643 --
644 If (p_rec.run_type_name = hr_api.g_varchar2) then
645 p_rec.run_type_name :=
646 pay_prt_shd.g_old_rec.run_type_name;
647 End If;
648 If (p_rec.run_method = hr_api.g_varchar2) then
649 p_rec.run_method :=
650 pay_prt_shd.g_old_rec.run_method;
651 End If;
652 If (p_rec.business_group_id = hr_api.g_number) then
653 p_rec.business_group_id :=
654 pay_prt_shd.g_old_rec.business_group_id;
655 End If;
656 If (p_rec.legislation_code = hr_api.g_varchar2) then
657 p_rec.legislation_code :=
658 pay_prt_shd.g_old_rec.legislation_code;
659 End If;
660 If (p_rec.shortname = hr_api.g_varchar2) then
661 p_rec.shortname :=
662 pay_prt_shd.g_old_rec.shortname;
663 End If;
664 If (p_rec.srs_flag = hr_api.g_varchar2) then
665 p_rec.srs_flag :=
666 pay_prt_shd.g_old_rec.srs_flag;
667 End If;
668 If (p_rec.run_information_category = hr_api.g_varchar2) then
669 p_rec.run_information_category :=
670 pay_prt_shd.g_old_rec.run_information_category;
671 End If;
672 If (p_rec.run_information1 = hr_api.g_varchar2) then
673 p_rec.run_information1 :=
674 pay_prt_shd.g_old_rec.run_information1;
675 End If;
676 If (p_rec.run_information2 = hr_api.g_varchar2) then
677 p_rec.run_information2 :=
678 pay_prt_shd.g_old_rec.run_information2;
679 End If;
680 If (p_rec.run_information3 = hr_api.g_varchar2) then
681 p_rec.run_information3 :=
682 pay_prt_shd.g_old_rec.run_information3;
683 End If;
684 If (p_rec.run_information4 = hr_api.g_varchar2) then
685 p_rec.run_information4 :=
686 pay_prt_shd.g_old_rec.run_information4;
687 End If;
688 If (p_rec.run_information5 = hr_api.g_varchar2) then
689 p_rec.run_information5 :=
690 pay_prt_shd.g_old_rec.run_information5;
691 End If;
692 If (p_rec.run_information6 = hr_api.g_varchar2) then
693 p_rec.run_information6 :=
694 pay_prt_shd.g_old_rec.run_information6;
695 End If;
696 If (p_rec.run_information7 = hr_api.g_varchar2) then
697 p_rec.run_information7 :=
698 pay_prt_shd.g_old_rec.run_information7;
699 End If;
700 If (p_rec.run_information8 = hr_api.g_varchar2) then
701 p_rec.run_information8 :=
702 pay_prt_shd.g_old_rec.run_information8;
703 End If;
704 If (p_rec.run_information9 = hr_api.g_varchar2) then
705 p_rec.run_information9 :=
706 pay_prt_shd.g_old_rec.run_information9;
707 End If;
708 If (p_rec.run_information10 = hr_api.g_varchar2) then
709 p_rec.run_information10 :=
710 pay_prt_shd.g_old_rec.run_information10;
711 End If;
712 If (p_rec.run_information11 = hr_api.g_varchar2) then
713 p_rec.run_information11 :=
714 pay_prt_shd.g_old_rec.run_information11;
715 End If;
716 If (p_rec.run_information12 = hr_api.g_varchar2) then
717 p_rec.run_information12 :=
718 pay_prt_shd.g_old_rec.run_information12;
719 End If;
720 If (p_rec.run_information13 = hr_api.g_varchar2) then
721 p_rec.run_information13 :=
722 pay_prt_shd.g_old_rec.run_information13;
723 End If;
724 If (p_rec.run_information14 = hr_api.g_varchar2) then
725 p_rec.run_information14 :=
726 pay_prt_shd.g_old_rec.run_information14;
727 End If;
728 If (p_rec.run_information15 = hr_api.g_varchar2) then
729 p_rec.run_information15 :=
730 pay_prt_shd.g_old_rec.run_information15;
731 End If;
732 If (p_rec.run_information16 = hr_api.g_varchar2) then
733 p_rec.run_information16 :=
734 pay_prt_shd.g_old_rec.run_information16;
735 End If;
736 If (p_rec.run_information17 = hr_api.g_varchar2) then
737 p_rec.run_information17 :=
738 pay_prt_shd.g_old_rec.run_information17;
739 End If;
740 If (p_rec.run_information18 = hr_api.g_varchar2) then
741 p_rec.run_information18 :=
742 pay_prt_shd.g_old_rec.run_information18;
743 End If;
744 If (p_rec.run_information19 = hr_api.g_varchar2) then
745 p_rec.run_information19 :=
746 pay_prt_shd.g_old_rec.run_information19;
747 End If;
748 If (p_rec.run_information20 = hr_api.g_varchar2) then
749 p_rec.run_information20 :=
750 pay_prt_shd.g_old_rec.run_information20;
751 End If;
752 If (p_rec.run_information21 = hr_api.g_varchar2) then
753 p_rec.run_information21 :=
754 pay_prt_shd.g_old_rec.run_information21;
755 End If;
756 If (p_rec.run_information22 = hr_api.g_varchar2) then
757 p_rec.run_information22 :=
758 pay_prt_shd.g_old_rec.run_information22;
759 End If;
760 If (p_rec.run_information23 = hr_api.g_varchar2) then
761 p_rec.run_information23 :=
762 pay_prt_shd.g_old_rec.run_information23;
763 End If;
764 If (p_rec.run_information24 = hr_api.g_varchar2) then
765 p_rec.run_information24 :=
766 pay_prt_shd.g_old_rec.run_information24;
767 End If;
768 If (p_rec.run_information25 = hr_api.g_varchar2) then
769 p_rec.run_information25 :=
770 pay_prt_shd.g_old_rec.run_information25;
771 End If;
772 If (p_rec.run_information26 = hr_api.g_varchar2) then
773 p_rec.run_information26 :=
774 pay_prt_shd.g_old_rec.run_information26;
775 End If;
776 If (p_rec.run_information27 = hr_api.g_varchar2) then
777 p_rec.run_information27 :=
778 pay_prt_shd.g_old_rec.run_information27;
779 End If;
780 If (p_rec.run_information28 = hr_api.g_varchar2) then
781 p_rec.run_information28 :=
782 pay_prt_shd.g_old_rec.run_information28;
783 End If;
784 If (p_rec.run_information29 = hr_api.g_varchar2) then
785 p_rec.run_information29 :=
786 pay_prt_shd.g_old_rec.run_information29;
787 End If;
788 If (p_rec.run_information30 = hr_api.g_varchar2) then
789 p_rec.run_information30 :=
790 pay_prt_shd.g_old_rec.run_information30;
791 End If;
792 --
793 End convert_defs;
794 --
795 -- ----------------------------------------------------------------------------
796 -- |---------------------------------< upd >----------------------------------|
797 -- ----------------------------------------------------------------------------
798 Procedure upd
799 (p_effective_date in date
800 ,p_datetrack_mode in varchar2
801 ,p_rec in out nocopy pay_prt_shd.g_rec_type
802 ) is
803 --
804 l_proc varchar2(72) := g_package||'upd';
805 l_validation_start_date date;
806 l_validation_end_date date;
807 --
808 Begin
809 hr_utility.set_location('Entering:'||l_proc, 5);
810 --
811 -- Ensure that the DateTrack update mode is valid
812 --
813 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
814 --
815 -- We must lock the row which we need to update.
816 --
817 pay_prt_shd.lck
818 (p_effective_date => p_effective_date
819 ,p_datetrack_mode => p_datetrack_mode
820 ,p_run_type_id => p_rec.run_type_id
821 ,p_object_version_number => p_rec.object_version_number
822 ,p_validation_start_date => l_validation_start_date
823 ,p_validation_end_date => l_validation_end_date
824 );
825 --
826 -- 1. During an update system defaults are used to determine if
827 -- arguments have been defaulted or not. We must therefore
828 -- derive the full record structure values to be updated.
829 --
830 -- 2. Call the supporting update validate operations.
831 --
832 pay_prt_upd.convert_defs(p_rec);
833 --
834 pay_prt_bus.update_validate
835 (p_rec => p_rec
836 ,p_effective_date => p_effective_date
837 ,p_datetrack_mode => p_datetrack_mode
838 ,p_validation_start_date => l_validation_start_date
839 ,p_validation_end_date => l_validation_end_date
840 );
841 --
842 -- Call the supporting pre-update operation
843 --
844 pre_update
845 (p_rec => p_rec
846 ,p_effective_date => p_effective_date
847 ,p_datetrack_mode => p_datetrack_mode
848 ,p_validation_start_date => l_validation_start_date
849 ,p_validation_end_date => l_validation_end_date
850 );
851 --
852 -- Update the row.
853 --
854 update_dml
855 (p_rec => p_rec
856 ,p_effective_date => p_effective_date
857 ,p_datetrack_mode => p_datetrack_mode
858 ,p_validation_start_date => l_validation_start_date
859 ,p_validation_end_date => l_validation_end_date
860 );
861 --
862 -- Call the supporting post-update operation
863 --
864 post_update
865 (p_rec => p_rec
866 ,p_effective_date => p_effective_date
867 ,p_datetrack_mode => p_datetrack_mode
868 ,p_validation_start_date => l_validation_start_date
869 ,p_validation_end_date => l_validation_end_date
870 );
871 End upd;
872 --
873 -- ----------------------------------------------------------------------------
874 -- |------------------------------< upd >-------------------------------------|
875 -- ----------------------------------------------------------------------------
876 Procedure upd
877 (p_effective_date in date
878 ,p_datetrack_mode in varchar2
879 ,p_run_type_id in number
880 ,p_object_version_number in out nocopy number
881 -- ,p_run_type_name in varchar2 default hr_api.g_varchar2
882 ,p_shortname in varchar2 default hr_api.g_varchar2
883 ,p_srs_flag in varchar2 default hr_api.g_varchar2
884 ,p_run_information_category in varchar2 default hr_api.g_varchar2
885 ,p_run_information1 in varchar2 default hr_api.g_varchar2
886 ,p_run_information2 in varchar2 default hr_api.g_varchar2
887 ,p_run_information3 in varchar2 default hr_api.g_varchar2
888 ,p_run_information4 in varchar2 default hr_api.g_varchar2
889 ,p_run_information5 in varchar2 default hr_api.g_varchar2
890 ,p_run_information6 in varchar2 default hr_api.g_varchar2
891 ,p_run_information7 in varchar2 default hr_api.g_varchar2
892 ,p_run_information8 in varchar2 default hr_api.g_varchar2
893 ,p_run_information9 in varchar2 default hr_api.g_varchar2
894 ,p_run_information10 in varchar2 default hr_api.g_varchar2
895 ,p_run_information11 in varchar2 default hr_api.g_varchar2
896 ,p_run_information12 in varchar2 default hr_api.g_varchar2
897 ,p_run_information13 in varchar2 default hr_api.g_varchar2
898 ,p_run_information14 in varchar2 default hr_api.g_varchar2
899 ,p_run_information15 in varchar2 default hr_api.g_varchar2
900 ,p_run_information16 in varchar2 default hr_api.g_varchar2
901 ,p_run_information17 in varchar2 default hr_api.g_varchar2
902 ,p_run_information18 in varchar2 default hr_api.g_varchar2
903 ,p_run_information19 in varchar2 default hr_api.g_varchar2
904 ,p_run_information20 in varchar2 default hr_api.g_varchar2
905 ,p_run_information21 in varchar2 default hr_api.g_varchar2
906 ,p_run_information22 in varchar2 default hr_api.g_varchar2
907 ,p_run_information23 in varchar2 default hr_api.g_varchar2
908 ,p_run_information24 in varchar2 default hr_api.g_varchar2
909 ,p_run_information25 in varchar2 default hr_api.g_varchar2
910 ,p_run_information26 in varchar2 default hr_api.g_varchar2
911 ,p_run_information27 in varchar2 default hr_api.g_varchar2
912 ,p_run_information28 in varchar2 default hr_api.g_varchar2
913 ,p_run_information29 in varchar2 default hr_api.g_varchar2
914 ,p_run_information30 in varchar2 default hr_api.g_varchar2
915 ,p_effective_start_date out nocopy date
916 ,p_effective_end_date out nocopy date
917 ) is
918 --
919 l_rec pay_prt_shd.g_rec_type;
920 l_proc varchar2(72) := g_package||'upd';
921 --
922 Begin
923 hr_utility.set_location('Entering:'||l_proc, 5);
924 --
925 -- Call conversion function to turn arguments into the
926 -- l_rec structure.
927 --
928 l_rec :=
929 pay_prt_shd.convert_args
930 (p_run_type_id
931 ,hr_api.g_varchar2
932 ,hr_api.g_varchar2
933 ,null
934 ,null
935 ,hr_api.g_number
936 ,hr_api.g_varchar2
937 ,p_shortname
938 ,p_srs_flag
939 ,p_run_information_category
940 ,p_run_information1
941 ,p_run_information2
942 ,p_run_information3
943 ,p_run_information4
944 ,p_run_information5
945 ,p_run_information6
946 ,p_run_information7
947 ,p_run_information8
948 ,p_run_information9
949 ,p_run_information10
950 ,p_run_information11
951 ,p_run_information12
952 ,p_run_information13
953 ,p_run_information14
954 ,p_run_information15
955 ,p_run_information16
956 ,p_run_information17
957 ,p_run_information18
958 ,p_run_information19
959 ,p_run_information20
960 ,p_run_information21
961 ,p_run_information22
962 ,p_run_information23
963 ,p_run_information24
964 ,p_run_information25
965 ,p_run_information26
966 ,p_run_information27
967 ,p_run_information28
968 ,p_run_information29
969 ,p_run_information30
970 ,p_object_version_number
971 );
972 --
973 -- Having converted the arguments into the
974 -- plsql record structure we call the corresponding record
975 -- business process.
976 --
977 pay_prt_upd.upd
978 (p_effective_date
979 ,p_datetrack_mode
980 ,l_rec
981 );
982 --
983 -- Set the out parameters
984 --
985 p_object_version_number := l_rec.object_version_number;
986 p_effective_start_date := l_rec.effective_start_date;
987 p_effective_end_date := l_rec.effective_end_date;
988 --
989 --
990 hr_utility.set_location(' Leaving:'||l_proc, 10);
991 End upd;
992 --
993 end pay_prt_upd;