1 Package Body per_sps_upd as
2 /* $Header: pespsrhi.pkb 120.5.12000000.1 2007/01/22 04:39:24 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_sps_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
21 -- this 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 per_sps_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 => 'per_spinal_point_steps_f'
79 ,p_base_key_column => 'step_id'
80 ,p_base_key_value => p_rec.step_id
81 );
82 --
83 per_sps_shd.g_api_dml := true; -- Set the api dml status
84 --
85 -- Update the per_spinal_point_steps_f Row
86 --
87 update per_spinal_point_steps_f
88 set
89 step_id = p_rec.step_id
90 ,business_group_id = p_rec.business_group_id
91 ,spinal_point_id = p_rec.spinal_point_id
92 ,grade_spine_id = p_rec.grade_spine_id
93 ,sequence = p_rec.sequence
94 ,request_id = p_rec.request_id
95 ,program_application_id = p_rec.program_application_id
96 ,program_id = p_rec.program_id
97 ,program_update_date = p_rec.program_update_date
98 ,information1 = p_rec.information1
99 ,information2 = p_rec.information2
100 ,information3 = p_rec.information3
101 ,information4 = p_rec.information4
102 ,information5 = p_rec.information5
103 ,information6 = p_rec.information6
104 ,information7 = p_rec.information7
105 ,information8 = p_rec.information8
106 ,information9 = p_rec.information9
107 ,information10 = p_rec.information10
108 ,information11 = p_rec.information11
109 ,information12 = p_rec.information12
110 ,information13 = p_rec.information13
111 ,information14 = p_rec.information14
112 ,information15 = p_rec.information15
113 ,information16 = p_rec.information16
114 ,information17 = p_rec.information17
115 ,information18 = p_rec.information18
116 ,information19 = p_rec.information19
117 ,information20 = p_rec.information20
118 ,information21 = p_rec.information21
119 ,information22 = p_rec.information22
120 ,information23 = p_rec.information23
121 ,information24 = p_rec.information24
122 ,information25 = p_rec.information25
123 ,information26 = p_rec.information26
124 ,information27 = p_rec.information27
125 ,information28 = p_rec.information28
126 ,information29 = p_rec.information29
127 ,information30 = p_rec.information30
128 ,information_category = p_rec.information_category
129 ,object_version_number = p_rec.object_version_number
130 where step_id = p_rec.step_id
131 and effective_start_date = p_validation_start_date
132 and effective_end_date = p_validation_end_date;
133 --
134 per_sps_shd.g_api_dml := false; -- Unset the api dml status
135 --
136 -- Set the effective start and end dates
137 --
138 p_rec.effective_start_date := p_validation_start_date;
139 p_rec.effective_end_date := p_validation_end_date;
140 End If;
141 --
142 hr_utility.set_location(' Leaving:'||l_proc, 15);
143 Exception
144 When hr_api.check_integrity_violated Then
145 -- A check constraint has been violated
146 per_sps_shd.g_api_dml := false; -- Unset the api dml status
147 per_sps_shd.constraint_error
148 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
149 When hr_api.unique_integrity_violated Then
150 -- Unique integrity has been violated
151 per_sps_shd.g_api_dml := false; -- Unset the api dml status
152 per_sps_shd.constraint_error
153 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
154 When Others Then
155 per_sps_shd.g_api_dml := false; -- Unset the api dml status
156 Raise;
157 End dt_update_dml;
158 --
159 -- ----------------------------------------------------------------------------
160 -- |------------------------------< update_dml >------------------------------|
161 -- ----------------------------------------------------------------------------
162 -- {Start Of Comments}
163 --
164 -- Description:
165 -- This procedure calls the dt_update_dml control logic which handles
166 -- the actual datetrack dml.
167 --
168 -- Prerequisites:
169 -- This is an internal private procedure which must be called from the upd
170 -- procedure.
171 --
172 -- In Parameters:
173 -- A Pl/Sql record structre.
174 --
175 -- Post Success:
176 -- Processing contines.
177 --
178 -- Post Failure:
179 -- No specific error handling is required within this procedure.
180 --
181 -- Developer Implementation Notes:
182 -- The update 'set' arguments list should be modified if any of your
183 -- attributes are not updateable.
184 --
185 -- Access Status:
186 -- Internal Row Handler Use Only.
187 --
188 -- {End Of Comments}
189 -- ----------------------------------------------------------------------------
190 Procedure update_dml
191 (p_rec in out nocopy per_sps_shd.g_rec_type
192 ,p_effective_date in date
193 ,p_datetrack_mode in varchar2
194 ,p_validation_start_date in date
195 ,p_validation_end_date in date
196 ) is
197 --
198 l_proc varchar2(72) := g_package||'update_dml';
199 --
200 Begin
201 hr_utility.set_location('Entering:'||l_proc, 5);
202 --
203 per_sps_upd.dt_update_dml
204 (p_rec => p_rec
205 ,p_effective_date => p_effective_date
206 ,p_datetrack_mode => p_datetrack_mode
207 ,p_validation_start_date => p_validation_start_date
208 ,p_validation_end_date => p_validation_end_date
209 );
210 --
211 hr_utility.set_location(' Leaving:'||l_proc, 10);
212 End update_dml;
213 --
214 -- ----------------------------------------------------------------------------
215 -- |----------------------------< dt_pre_update >-----------------------------|
216 -- ----------------------------------------------------------------------------
217 -- {Start Of Comments}
218 --
219 -- Description:
220 -- The dt_pre_update procedure controls the execution
221 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
222 -- and UPDATE_CHANGE_INSERT only. The execution required is as
223 -- follows:
224 --
225 -- 1) Providing the datetrack update mode is not 'CORRECTION'
226 -- then set the effective end date of the current row (this
227 -- will be the validation_start_date - 1).
228 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
229 -- corresponding delete_dml process to delete any future rows
230 -- where the effective_start_date is greater than or equal to
231 -- the validation_start_date.
232 -- 3) Call the insert_dml process to insert the new updated row
233 -- details.
234 --
235 -- Prerequisites:
236 -- This is an internal procedure which is called from the
237 -- pre_update procedure.
238 --
239 -- In Parameters:
240 --
241 -- Post Success:
242 -- Processing continues.
243 --
244 -- Post Failure:
245 -- If an error has occurred, an error message and exception will be raised
246 -- but not handled.
247 --
248 -- Developer Implementation Notes:
249 -- This is an internal procedure which is required by Datetrack. Don't
250 -- remove or modify.
251 --
252 -- Access Status:
253 -- Internal Row Handler Use Only.
254 --
255 -- {End Of Comments}
256 -- ----------------------------------------------------------------------------
257 Procedure dt_pre_update
258 (p_rec in out nocopy per_sps_shd.g_rec_type
259 ,p_effective_date in date
260 ,p_datetrack_mode in varchar2
261 ,p_validation_start_date in date
262 ,p_validation_end_date in date
263 ) is
264 --
265 l_proc varchar2(72) := g_package||'dt_pre_update';
266 l_dummy_version_number number;
267 --
268 Begin
269 hr_utility.set_location('Entering:'||l_proc, 5);
270 If (p_datetrack_mode <> hr_api.g_correction) then
271 --
272 -- Update the current effective end date
273 --
274 per_sps_shd.upd_effective_end_date
275 (p_effective_date => p_effective_date
276 ,p_base_key_value => p_rec.step_id
277 ,p_new_effective_end_date => (p_validation_start_date - 1)
278 ,p_validation_start_date => p_validation_start_date
279 ,p_validation_end_date => p_validation_end_date
280 ,p_object_version_number => l_dummy_version_number
281 );
282 --
283 If (p_datetrack_mode = hr_api.g_update_override) then
284 --
285 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
286 -- delete any future rows
287 --
288 per_sps_del.delete_dml
289 (p_rec => p_rec
290 ,p_effective_date => p_effective_date
291 ,p_datetrack_mode => p_datetrack_mode
292 ,p_validation_start_date => p_validation_start_date
293 ,p_validation_end_date => p_validation_end_date
294 );
295 End If;
296 --
297 -- We must now insert the updated row
298 --
299 per_sps_ins.insert_dml
300 (p_rec => p_rec
301 ,p_effective_date => p_effective_date
302 ,p_datetrack_mode => p_datetrack_mode
303 ,p_validation_start_date => p_validation_start_date
304 ,p_validation_end_date => p_validation_end_date
305 );
306 End If;
307 hr_utility.set_location(' Leaving:'||l_proc, 20);
308 End dt_pre_update;
309 --
310 -- ----------------------------------------------------------------------------
311 -- |------------------------------< pre_update >------------------------------|
312 -- ----------------------------------------------------------------------------
313 -- {Start Of Comments}
314 --
315 -- Description:
316 -- This private procedure contains any processing which is required before
317 -- the update dml.
318 --
319 -- Prerequisites:
320 -- This is an internal procedure which is called from the upd procedure.
321 --
322 -- In Parameters:
323 -- A Pl/Sql record structure.
324 --
325 -- Post Success:
326 -- Processing continues.
327 --
328 -- Post Failure:
329 -- If an error has occurred, an error message and exception will be raised
330 -- but not handled.
331 -- Developer Implementation Notes:
332 -- Any pre-processing required before the update dml is issued should be
333 -- coded within this procedure. It is important to note that any 3rd party
334 -- maintenance should be reviewed before placing in this procedure. The call
335 -- to the dt_update_dml procedure should NOT be removed.
336 --
337 -- Access Status:
338 -- Internal Row Handler Use Only.
339 --
340 -- {End Of Comments}
341 -- ----------------------------------------------------------------------------
342 Procedure pre_update
343 (p_rec in out nocopy per_sps_shd.g_rec_type
344 ,p_effective_date in date
345 ,p_datetrack_mode in varchar2
346 ,p_validation_start_date in date
347 ,p_validation_end_date in date
348 ) is
349 --
350 l_proc varchar2(72) := g_package||'pre_update';
351 --
352 Begin
353 hr_utility.set_location('Entering:'||l_proc, 5);
354 --
355 --
356 --
357 dt_pre_update
358 (p_rec => p_rec
359 ,p_effective_date => p_effective_date
360 ,p_datetrack_mode => p_datetrack_mode
361 ,p_validation_start_date => p_validation_start_date
362 ,p_validation_end_date => p_validation_end_date
363 );
364 --
365 hr_utility.set_location(' Leaving:'||l_proc, 10);
366 End pre_update;
367 --
368 -- ----------------------------------------------------------------------------
369 -- |----------------------------< post_update >-------------------------------|
370 -- ----------------------------------------------------------------------------
371 -- {Start Of Comments}
372 --
373 -- Description:
374 -- This private procedure contains any processing which is required after
375 -- the update dml.
376 --
377 -- Prerequisites:
378 -- This is an internal procedure which is called from the upd procedure.
379 --
380 -- In Parameters:
381 -- A Pl/Sql record structure.
382 --
383 -- Post Success:
384 -- Processing continues.
385 --
386 -- Post Failure:
387 -- If an error has occurred, an error message and exception will be raised
388 -- but not handled.
389 --
390 -- Developer Implementation Notes:
391 -- Any post-processing required after the update dml is issued should be
392 -- coded within this procedure. It is important to note that any 3rd party
393 -- maintenance should be reviewed before placing in this procedure.
394 --
395 -- Access Status:
396 -- Internal Row Handler Use Only.
397 --
398 -- {End Of Comments}
399 -- ----------------------------------------------------------------------------
400 Procedure post_update
401 (p_rec in per_sps_shd.g_rec_type
402 ,p_effective_date in date
403 ,p_datetrack_mode in varchar2
404 ,p_validation_start_date in date
405 ,p_validation_end_date in date
406 ) is
407 --
408 l_proc varchar2(72) := g_package||'post_update';
409 --
410 Begin
411 hr_utility.set_location('Entering:'||l_proc, 5);
412 begin
413 --
414 per_sps_rku.after_update
415 (p_effective_date
416 => p_effective_date
417 ,p_datetrack_mode
418 => p_datetrack_mode
419 ,p_validation_start_date
420 => p_validation_start_date
421 ,p_validation_end_date
422 => p_validation_end_date
423 ,p_step_id
424 => p_rec.step_id
425 ,p_effective_start_date
426 => p_rec.effective_start_date
427 ,p_effective_end_date
428 => p_rec.effective_end_date
429 ,p_business_group_id
430 => p_rec.business_group_id
431 ,p_spinal_point_id
432 => p_rec.spinal_point_id
433 ,p_grade_spine_id
434 => p_rec.grade_spine_id
435 ,p_sequence
436 => p_rec.sequence
437 ,p_request_id
438 => p_rec.request_id
439 ,p_program_application_id
440 => p_rec.program_application_id
441 ,p_program_id
442 => p_rec.program_id
443 ,p_program_update_date
444 => p_rec.program_update_date
445 ,p_information1
446 => p_rec.information1
447 ,p_information2
448 => p_rec.information2
449 ,p_information3
450 => p_rec.information3
451 ,p_information4
452 => p_rec.information4
453 ,p_information5
454 => p_rec.information5
455 ,p_information6
456 => p_rec.information6
457 ,p_information7
458 => p_rec.information7
459 ,p_information8
460 => p_rec.information8
461 ,p_information9
462 => p_rec.information9
463 ,p_information10
464 => p_rec.information10
465 ,p_information11
466 => p_rec.information11
467 ,p_information12
468 => p_rec.information12
469 ,p_information13
470 => p_rec.information13
471 ,p_information14
472 => p_rec.information14
473 ,p_information15
474 => p_rec.information15
475 ,p_information16
476 => p_rec.information16
477 ,p_information17
478 => p_rec.information17
479 ,p_information18
480 => p_rec.information18
481 ,p_information19
482 => p_rec.information19
483 ,p_information20
484 => p_rec.information20
485 ,p_information21
486 => p_rec.information21
487 ,p_information22
488 => p_rec.information22
489 ,p_information23
490 => p_rec.information23
491 ,p_information24
492 => p_rec.information24
493 ,p_information25
494 => p_rec.information25
495 ,p_information26
496 => p_rec.information26
497 ,p_information27
498 => p_rec.information27
499 ,p_information28
500 => p_rec.information28
501 ,p_information29
502 => p_rec.information29
503 ,p_information30
504 => p_rec.information30
505 ,p_information_category
506 => p_rec.information_category
507 ,p_object_version_number
508 => p_rec.object_version_number
509 ,p_effective_start_date_o
510 => per_sps_shd.g_old_rec.effective_start_date
511 ,p_effective_end_date_o
512 => per_sps_shd.g_old_rec.effective_end_date
513 ,p_business_group_id_o
514 => per_sps_shd.g_old_rec.business_group_id
515 ,p_spinal_point_id_o
516 => per_sps_shd.g_old_rec.spinal_point_id
517 ,p_grade_spine_id_o
518 => per_sps_shd.g_old_rec.grade_spine_id
519 ,p_sequence_o
520 => per_sps_shd.g_old_rec.sequence
521 ,p_request_id_o
522 => per_sps_shd.g_old_rec.request_id
523 ,p_program_application_id_o
524 => per_sps_shd.g_old_rec.program_application_id
525 ,p_program_id_o
526 => per_sps_shd.g_old_rec.program_id
527 ,p_program_update_date_o
528 => per_sps_shd.g_old_rec.program_update_date
529 ,p_information1_o
530 => per_sps_shd.g_old_rec.information1
531 ,p_information2_o
532 => per_sps_shd.g_old_rec.information2
533 ,p_information3_o
534 => per_sps_shd.g_old_rec.information3
535 ,p_information4_o
536 => per_sps_shd.g_old_rec.information4
537 ,p_information5_o
538 => per_sps_shd.g_old_rec.information5
539 ,p_information6_o
540 => per_sps_shd.g_old_rec.information6
541 ,p_information7_o
542 => per_sps_shd.g_old_rec.information7
543 ,p_information8_o
544 => per_sps_shd.g_old_rec.information8
545 ,p_information9_o
546 => per_sps_shd.g_old_rec.information9
547 ,p_information10_o
548 => per_sps_shd.g_old_rec.information10
549 ,p_information11_o
550 => per_sps_shd.g_old_rec.information11
551 ,p_information12_o
552 => per_sps_shd.g_old_rec.information12
553 ,p_information13_o
554 => per_sps_shd.g_old_rec.information13
555 ,p_information14_o
556 => per_sps_shd.g_old_rec.information14
557 ,p_information15_o
558 => per_sps_shd.g_old_rec.information15
559 ,p_information16_o
560 => per_sps_shd.g_old_rec.information16
561 ,p_information17_o
562 => per_sps_shd.g_old_rec.information17
563 ,p_information18_o
564 => per_sps_shd.g_old_rec.information18
565 ,p_information19_o
566 => per_sps_shd.g_old_rec.information19
567 ,p_information20_o
568 => per_sps_shd.g_old_rec.information20
569 ,p_information21_o
570 => per_sps_shd.g_old_rec.information21
571 ,p_information22_o
572 => per_sps_shd.g_old_rec.information22
573 ,p_information23_o
574 => per_sps_shd.g_old_rec.information23
575 ,p_information24_o
576 => per_sps_shd.g_old_rec.information24
577 ,p_information25_o
578 => per_sps_shd.g_old_rec.information25
579 ,p_information26_o
580 => per_sps_shd.g_old_rec.information26
581 ,p_information27_o
582 => per_sps_shd.g_old_rec.information27
583 ,p_information28_o
584 => per_sps_shd.g_old_rec.information28
585 ,p_information29_o
586 => per_sps_shd.g_old_rec.information29
587 ,p_information30_o
588 => per_sps_shd.g_old_rec.information30
589 ,p_information_category_o
590 => per_sps_shd.g_old_rec.information_category
591 ,p_object_version_number_o
592 => per_sps_shd.g_old_rec.object_version_number
593 );
594 --
595 exception
596 --
597 when hr_api.cannot_find_prog_unit then
598 --
599 hr_api.cannot_find_prog_unit_error
600 (p_module_name => 'PER_SPINAL_POINT_STEPS_F'
601 ,p_hook_type => 'AU');
602 --
603 end;
604 --
605 hr_utility.set_location(' Leaving:'||l_proc, 10);
606 End post_update;
607 --
608 -- ----------------------------------------------------------------------------
609 -- |-----------------------------< convert_defs >-----------------------------|
610 -- ----------------------------------------------------------------------------
611 -- {Start Of Comments}
612 --
613 -- Description:
614 -- The Convert_Defs procedure has one very important function:
615 -- It must return the record structure for the row with all system defaulted
616 -- values converted into its corresponding parameter value for update. When
617 -- we attempt to update a row through the Upd process , certain
618 -- parameters can be defaulted which enables flexibility in the calling of
619 -- the upd process (e.g. only attributes which need to be updated need to be
620 -- specified). For the upd process to determine which attributes
621 -- have NOT been specified we need to check if the parameter has a reserved
622 -- system default value. Therefore, for all parameters which have a
623 -- corresponding reserved system default mechanism specified we need to
624 -- check if a system default is being used. If a system default is being
625 -- used then we convert the defaulted value into its corresponding attribute
626 -- value held in the g_old_rec data structure.
627 --
628 -- Prerequisites:
629 -- This private function can only be called from the upd process.
630 --
631 -- In Parameters:
632 -- A Pl/Sql record structure.
633 --
634 -- Post Success:
635 -- The record structure will be returned with all system defaulted parameter
636 -- values converted into its current row attribute value.
637 --
638 -- Post Failure:
639 -- No direct error handling is required within this function. Any possible
640 -- errors within this procedure will be a PL/SQL value error due to
641 -- conversion of datatypes or data lengths.
642 --
643 -- Developer Implementation Notes:
644 -- None.
645 --
646 -- Access Status:
647 -- Internal Row Handler Use Only.
648 --
649 -- {End Of Comments}
650 -- ----------------------------------------------------------------------------
651 Procedure convert_defs
652 (p_rec in out nocopy per_sps_shd.g_rec_type
653 ) is
654 --
655 Begin
656 --
657 -- We must now examine each argument value in the
658 -- p_rec plsql record structure
659 -- to see if a system default is being used. If a system default
660 -- is being used then we must set to the 'current' argument value.
661 --
662 If (p_rec.business_group_id = hr_api.g_number) then
663 p_rec.business_group_id :=
664 per_sps_shd.g_old_rec.business_group_id;
665 End If;
666 If (p_rec.spinal_point_id = hr_api.g_number) then
667 p_rec.spinal_point_id :=
668 per_sps_shd.g_old_rec.spinal_point_id;
669 End If;
670 If (p_rec.grade_spine_id = hr_api.g_number) then
671 p_rec.grade_spine_id :=
672 per_sps_shd.g_old_rec.grade_spine_id;
673 End If;
674 If (p_rec.sequence = hr_api.g_number) then
675 p_rec.sequence :=
676 per_sps_shd.g_old_rec.sequence;
677 End If;
678 If (p_rec.request_id = hr_api.g_number) then
679 p_rec.request_id :=
680 per_sps_shd.g_old_rec.request_id;
681 End If;
682 If (p_rec.program_application_id = hr_api.g_number) then
683 p_rec.program_application_id :=
684 per_sps_shd.g_old_rec.program_application_id;
685 End If;
686 If (p_rec.program_id = hr_api.g_number) then
687 p_rec.program_id :=
688 per_sps_shd.g_old_rec.program_id;
689 End If;
690 If (p_rec.program_update_date = hr_api.g_date) then
691 p_rec.program_update_date :=
692 per_sps_shd.g_old_rec.program_update_date;
693 End If;
694 If (p_rec.information1 = hr_api.g_varchar2) then
695 p_rec.information1 :=
696 per_sps_shd.g_old_rec.information1;
697 End If;
698 If (p_rec.information2 = hr_api.g_varchar2) then
699 p_rec.information2 :=
700 per_sps_shd.g_old_rec.information2;
701 End If;
702 If (p_rec.information3 = hr_api.g_varchar2) then
703 p_rec.information3 :=
704 per_sps_shd.g_old_rec.information3;
705 End If;
706 If (p_rec.information4 = hr_api.g_varchar2) then
707 p_rec.information4 :=
708 per_sps_shd.g_old_rec.information4;
709 End If;
710 If (p_rec.information5 = hr_api.g_varchar2) then
711 p_rec.information5 :=
712 per_sps_shd.g_old_rec.information5;
713 End If;
714 If (p_rec.information6 = hr_api.g_varchar2) then
715 p_rec.information6 :=
716 per_sps_shd.g_old_rec.information6;
717 End If;
718 If (p_rec.information7 = hr_api.g_varchar2) then
719 p_rec.information7 :=
720 per_sps_shd.g_old_rec.information7;
721 End If;
722 If (p_rec.information8 = hr_api.g_varchar2) then
723 p_rec.information8 :=
724 per_sps_shd.g_old_rec.information8;
725 End If;
726 If (p_rec.information9 = hr_api.g_varchar2) then
727 p_rec.information9 :=
728 per_sps_shd.g_old_rec.information9;
729 End If;
730 If (p_rec.information10 = hr_api.g_varchar2) then
731 p_rec.information10 :=
732 per_sps_shd.g_old_rec.information10;
733 End If;
734 If (p_rec.information11 = hr_api.g_varchar2) then
735 p_rec.information11 :=
736 per_sps_shd.g_old_rec.information11;
737 End If;
738 If (p_rec.information12 = hr_api.g_varchar2) then
739 p_rec.information12 :=
740 per_sps_shd.g_old_rec.information12;
741 End If;
742 If (p_rec.information13 = hr_api.g_varchar2) then
743 p_rec.information13 :=
744 per_sps_shd.g_old_rec.information13;
745 End If;
746 If (p_rec.information14 = hr_api.g_varchar2) then
747 p_rec.information14 :=
748 per_sps_shd.g_old_rec.information14;
749 End If;
750 If (p_rec.information15 = hr_api.g_varchar2) then
751 p_rec.information15 :=
752 per_sps_shd.g_old_rec.information15;
753 End If;
754 If (p_rec.information16 = hr_api.g_varchar2) then
755 p_rec.information16 :=
756 per_sps_shd.g_old_rec.information16;
757 End If;
758 If (p_rec.information17 = hr_api.g_varchar2) then
759 p_rec.information17 :=
760 per_sps_shd.g_old_rec.information17;
761 End If;
762 If (p_rec.information18 = hr_api.g_varchar2) then
763 p_rec.information18 :=
764 per_sps_shd.g_old_rec.information18;
765 End If;
766 If (p_rec.information19 = hr_api.g_varchar2) then
767 p_rec.information19 :=
768 per_sps_shd.g_old_rec.information19;
769 End If;
770 If (p_rec.information20 = hr_api.g_varchar2) then
771 p_rec.information20 :=
772 per_sps_shd.g_old_rec.information20;
773 End If;
774 If (p_rec.information21 = hr_api.g_varchar2) then
775 p_rec.information21 :=
776 per_sps_shd.g_old_rec.information21;
777 End If;
778 If (p_rec.information22 = hr_api.g_varchar2) then
779 p_rec.information22 :=
780 per_sps_shd.g_old_rec.information22;
781 End If;
782 If (p_rec.information23 = hr_api.g_varchar2) then
783 p_rec.information23 :=
784 per_sps_shd.g_old_rec.information23;
785 End If;
786 If (p_rec.information24 = hr_api.g_varchar2) then
787 p_rec.information24 :=
788 per_sps_shd.g_old_rec.information24;
789 End If;
790 If (p_rec.information25 = hr_api.g_varchar2) then
791 p_rec.information25 :=
792 per_sps_shd.g_old_rec.information25;
793 End If;
794 If (p_rec.information26 = hr_api.g_varchar2) then
795 p_rec.information26 :=
796 per_sps_shd.g_old_rec.information26;
797 End If;
798 If (p_rec.information27 = hr_api.g_varchar2) then
799 p_rec.information27 :=
800 per_sps_shd.g_old_rec.information27;
801 End If;
802 If (p_rec.information28 = hr_api.g_varchar2) then
803 p_rec.information28 :=
804 per_sps_shd.g_old_rec.information28;
805 End If;
806 If (p_rec.information29 = hr_api.g_varchar2) then
807 p_rec.information29 :=
808 per_sps_shd.g_old_rec.information29;
809 End If;
810 If (p_rec.information30 = hr_api.g_varchar2) then
811 p_rec.information30 :=
812 per_sps_shd.g_old_rec.information30;
813 End If;
814 If (p_rec.information_category = hr_api.g_varchar2) then
815 p_rec.information_category :=
816 per_sps_shd.g_old_rec.information_category;
817 End If;
818 --
819 End convert_defs;
820 --
821 -- ----------------------------------------------------------------------------
822 -- |---------------------------------< upd >----------------------------------|
823 -- ----------------------------------------------------------------------------
824 Procedure upd
825 (p_effective_date in date
826 ,p_datetrack_mode in varchar2
827 ,p_rec in out nocopy per_sps_shd.g_rec_type
828 ) is
829 --
830 l_proc varchar2(72) := g_package||'upd';
831 l_validation_start_date date;
832 l_validation_end_date date;
833 --
834 Begin
835 hr_utility.set_location('Entering:'||l_proc, 5);
836 --
837 -- Ensure that the DateTrack update mode is valid
838 --
839 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
840 --
841 -- We must lock the row which we need to update.
842 --
843 per_sps_shd.lck
844 (p_effective_date => p_effective_date
845 ,p_datetrack_mode => p_datetrack_mode
846 ,p_step_id => p_rec.step_id
847 ,p_object_version_number => p_rec.object_version_number
848 ,p_validation_start_date => l_validation_start_date
849 ,p_validation_end_date => l_validation_end_date
850 );
851 --
852 -- 1. During an update system defaults are used to determine if
853 -- arguments have been defaulted or not. We must therefore
854 -- derive the full record structure values to be updated.
855 --
856 -- 2. Call the supporting update validate operations.
857 --
858 per_sps_upd.convert_defs(p_rec);
859 --
860 per_sps_bus.update_validate
861 (p_rec => p_rec
862 ,p_effective_date => p_effective_date
863 ,p_datetrack_mode => p_datetrack_mode
864 ,p_validation_start_date => l_validation_start_date
865 ,p_validation_end_date => l_validation_end_date
866 );
867 --
868 -- Call to raise any errors on multi-message list
869 hr_multi_message.end_validation_set;
870 --
871 -- Call the supporting pre-update operation
872 --
873 pre_update
874 (p_rec => p_rec
875 ,p_effective_date => p_effective_date
876 ,p_datetrack_mode => p_datetrack_mode
877 ,p_validation_start_date => l_validation_start_date
878 ,p_validation_end_date => l_validation_end_date
879 );
880 --
881 -- Update the row.
882 --
883 update_dml
884 (p_rec => p_rec
885 ,p_effective_date => p_effective_date
886 ,p_datetrack_mode => p_datetrack_mode
887 ,p_validation_start_date => l_validation_start_date
888 ,p_validation_end_date => l_validation_end_date
889 );
890 --
891 -- Call the supporting post-update operation
892 --
893 post_update
894 (p_rec => p_rec
895 ,p_effective_date => p_effective_date
896 ,p_datetrack_mode => p_datetrack_mode
897 ,p_validation_start_date => l_validation_start_date
898 ,p_validation_end_date => l_validation_end_date
899 );
900 --
901 -- Call to raise any errors on multi-message list
902 hr_multi_message.end_validation_set;
903 End upd;
904 --
905 -- ----------------------------------------------------------------------------
906 -- |------------------------------< upd >-------------------------------------|
907 -- ----------------------------------------------------------------------------
908 Procedure upd
909 (p_effective_date in date
910 ,p_datetrack_mode in varchar2
911 ,p_step_id in number
912 ,p_object_version_number in out nocopy number
913 ,p_business_group_id in number default hr_api.g_number
914 ,p_spinal_point_id in number default hr_api.g_number
915 ,p_grade_spine_id in number default hr_api.g_number
916 ,p_sequence in number default hr_api.g_number
917 ,p_request_id in number default hr_api.g_number
918 ,p_program_application_id in number default hr_api.g_number
919 ,p_program_id in number default hr_api.g_number
920 ,p_program_update_date in date default hr_api.g_date
921 ,p_information1 in varchar2 default hr_api.g_varchar2
922 ,p_information2 in varchar2 default hr_api.g_varchar2
923 ,p_information3 in varchar2 default hr_api.g_varchar2
924 ,p_information4 in varchar2 default hr_api.g_varchar2
925 ,p_information5 in varchar2 default hr_api.g_varchar2
926 ,p_information6 in varchar2 default hr_api.g_varchar2
927 ,p_information7 in varchar2 default hr_api.g_varchar2
928 ,p_information8 in varchar2 default hr_api.g_varchar2
929 ,p_information9 in varchar2 default hr_api.g_varchar2
930 ,p_information10 in varchar2 default hr_api.g_varchar2
931 ,p_information11 in varchar2 default hr_api.g_varchar2
932 ,p_information12 in varchar2 default hr_api.g_varchar2
933 ,p_information13 in varchar2 default hr_api.g_varchar2
934 ,p_information14 in varchar2 default hr_api.g_varchar2
935 ,p_information15 in varchar2 default hr_api.g_varchar2
936 ,p_information16 in varchar2 default hr_api.g_varchar2
937 ,p_information17 in varchar2 default hr_api.g_varchar2
938 ,p_information18 in varchar2 default hr_api.g_varchar2
939 ,p_information19 in varchar2 default hr_api.g_varchar2
940 ,p_information20 in varchar2 default hr_api.g_varchar2
941 ,p_information21 in varchar2 default hr_api.g_varchar2
942 ,p_information22 in varchar2 default hr_api.g_varchar2
943 ,p_information23 in varchar2 default hr_api.g_varchar2
944 ,p_information24 in varchar2 default hr_api.g_varchar2
945 ,p_information25 in varchar2 default hr_api.g_varchar2
946 ,p_information26 in varchar2 default hr_api.g_varchar2
947 ,p_information27 in varchar2 default hr_api.g_varchar2
948 ,p_information28 in varchar2 default hr_api.g_varchar2
949 ,p_information29 in varchar2 default hr_api.g_varchar2
950 ,p_information30 in varchar2 default hr_api.g_varchar2
951 ,p_information_category in varchar2 default hr_api.g_varchar2
952 ,p_effective_start_date out nocopy date
953 ,p_effective_end_date out nocopy date
954 ) is
955 --
956 l_rec per_sps_shd.g_rec_type;
957 l_proc varchar2(72) := g_package||'upd';
958 --
959 Begin
960 hr_utility.set_location('Entering:'||l_proc, 5);
961 --
962 -- Call conversion function to turn arguments into the
963 -- l_rec structure.
964 --
965 l_rec :=
966 per_sps_shd.convert_args
967 (p_step_id
968 ,null
969 ,null
970 ,p_business_group_id
971 ,p_spinal_point_id
972 ,p_grade_spine_id
973 ,p_sequence
974 ,p_request_id
975 ,p_program_application_id
976 ,p_program_id
977 ,p_program_update_date
978 ,p_information1
979 ,p_information2
980 ,p_information3
981 ,p_information4
982 ,p_information5
983 ,p_information6
984 ,p_information7
985 ,p_information8
986 ,p_information9
987 ,p_information10
988 ,p_information11
989 ,p_information12
990 ,p_information13
991 ,p_information14
992 ,p_information15
993 ,p_information16
994 ,p_information17
995 ,p_information18
996 ,p_information19
997 ,p_information20
998 ,p_information21
999 ,p_information22
1000 ,p_information23
1001 ,p_information24
1002 ,p_information25
1003 ,p_information26
1004 ,p_information27
1005 ,p_information28
1006 ,p_information29
1007 ,p_information30
1008 ,p_information_category
1009 ,p_object_version_number
1010 );
1011 --
1012 -- Having converted the arguments into the
1013 -- plsql record structure we call the corresponding record
1014 -- business process.
1015 --
1016 per_sps_upd.upd
1017 (p_effective_date
1018 ,p_datetrack_mode
1019 ,l_rec
1020 );
1021 --
1022 -- Set the out parameters
1023 --
1024 p_object_version_number := l_rec.object_version_number;
1025 p_effective_start_date := l_rec.effective_start_date;
1026 p_effective_end_date := l_rec.effective_end_date;
1027 --
1028 --
1029 hr_utility.set_location(' Leaving:'||l_proc, 10);
1030 End upd;
1031 --
1032 end per_sps_upd;