DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PDP_UPD

Source


1 Package Body per_pdp_upd as
2 /* $Header: pepdprhi.pkb 115.8 2004/01/29 05:53:10 adudekul noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_pdp_upd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< update_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the actual dml update logic. The processing of
17 --   this procedure is:
18 --   1) Increment the object_version_number by 1 if the object_version_number
19 --      is defined as an attribute for this entity.
20 --   2) To set and unset the g_api_dml status as required (as we are about to
21 --      perform dml).
22 --   3) To update the specified row in the schema using the primary key in
23 --      the predicates.
24 --   4) To trap any constraint violations that may have occurred.
25 --   5) To raise any other errors.
26 --
27 -- Prerequisites:
28 --   This is an internal private procedure which must be called from the upd
29 --   procedure.
30 --
31 -- In Parameters:
32 --   A Pl/Sql record structre.
33 --
34 -- Post Success:
35 --   The specified row will be updated in the schema.
36 --
37 -- Post Failure:
38 --   On the update dml failure it is important to note that we always reset the
39 --   g_api_dml status to false.
40 --   If a check, unique or parent integrity constraint violation is raised the
41 --   constraint_error procedure will be called.
42 --   If any other error is reported, the error will be raised after the
43 --   g_api_dml status is reset.
44 --
45 -- Developer Implementation Notes:
46 --   The update 'set' attribute list should be modified if any of your
47 --   attributes are not updateable.
48 --
49 -- Access Status:
50 --   Internal Row Handler Use Only.
51 --
52 -- {End Of Comments}
53 -- ----------------------------------------------------------------------------
54 Procedure update_dml
55   (p_rec in out nocopy per_pdp_shd.g_rec_type
56   ) is
57 --
58   l_proc  varchar2(72) := g_package||'update_dml';
59 --
60 Begin
61   hr_utility.set_location('Entering:'||l_proc, 5);
62   --
63   -- Increment the object version
64   p_rec.object_version_number := p_rec.object_version_number + 1;
65   --
66   --
67   --
68   -- Update the per_periods_of_placement Row
69   --
70   update per_periods_of_placement
71     set
72      object_version_number           = p_rec.object_version_number
73     ,actual_termination_date         = p_rec.actual_termination_date
74     ,projected_termination_date      = p_rec.projected_termination_date
75     ,termination_reason              = p_rec.termination_reason
76     ,attribute_category              = p_rec.attribute_category
77     ,attribute1                      = p_rec.attribute1
78     ,attribute2                      = p_rec.attribute2
79     ,attribute3                      = p_rec.attribute3
80     ,attribute4                      = p_rec.attribute4
81     ,attribute5                      = p_rec.attribute5
82     ,attribute6                      = p_rec.attribute6
83     ,attribute7                      = p_rec.attribute7
84     ,attribute8                      = p_rec.attribute8
85     ,attribute9                      = p_rec.attribute9
86     ,attribute10                     = p_rec.attribute10
87     ,attribute11                     = p_rec.attribute11
88     ,attribute12                     = p_rec.attribute12
89     ,attribute13                     = p_rec.attribute13
90     ,attribute14                     = p_rec.attribute14
91     ,attribute15                     = p_rec.attribute15
92     ,attribute16                     = p_rec.attribute16
93     ,attribute17                     = p_rec.attribute17
94     ,attribute18                     = p_rec.attribute18
95     ,attribute19                     = p_rec.attribute19
96     ,attribute20                     = p_rec.attribute20
97     ,attribute21                     = p_rec.attribute21
98     ,attribute22                     = p_rec.attribute22
99     ,attribute23                     = p_rec.attribute23
100     ,attribute24                     = p_rec.attribute24
101     ,attribute25                     = p_rec.attribute25
102     ,attribute26                     = p_rec.attribute26
103     ,attribute27                     = p_rec.attribute27
104     ,attribute28                     = p_rec.attribute28
105     ,attribute29                     = p_rec.attribute29
106     ,attribute30                     = p_rec.attribute30
107     ,information_category            = p_rec.information_category
108     ,information1                    = p_rec.information1
109     ,information2                    = p_rec.information2
110     ,information3                    = p_rec.information3
111     ,information4                    = p_rec.information4
112     ,information5                    = p_rec.information5
113     ,information6                    = p_rec.information6
114     ,information7                    = p_rec.information7
115     ,information8                    = p_rec.information8
116     ,information9                    = p_rec.information9
117     ,information10                   = p_rec.information10
118     ,information11                   = p_rec.information11
119     ,information12                   = p_rec.information12
120     ,information13                   = p_rec.information13
121     ,information14                   = p_rec.information14
122     ,information15                   = p_rec.information15
123     ,information16                   = p_rec.information16
124     ,information17                   = p_rec.information17
125     ,information18                   = p_rec.information18
126     ,information19                   = p_rec.information19
127     ,information20                   = p_rec.information20
128     ,information21                   = p_rec.information21
129     ,information22                   = p_rec.information22
130     ,information23                   = p_rec.information23
131     ,information24                   = p_rec.information24
132     ,information25                   = p_rec.information25
133     ,information26                   = p_rec.information26
134     ,information27                   = p_rec.information27
135     ,information28                   = p_rec.information28
136     ,information29                   = p_rec.information29
137     ,information30                   = p_rec.information30
138     ,final_process_date              = p_rec.final_process_date
139     ,last_standard_process_date      = p_rec.last_standard_process_date
140     where period_of_placement_id = p_rec.period_of_placement_id;
141   --
142   --
143   --
144   hr_utility.set_location(' Leaving:'||l_proc, 10);
145 --
146 Exception
147   When hr_api.check_integrity_violated Then
148     -- A check constraint has been violated
149     --
150     per_pdp_shd.constraint_error
151       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
152   When hr_api.parent_integrity_violated Then
153     -- Parent integrity has been violated
154     --
155     per_pdp_shd.constraint_error
156       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
157   When hr_api.unique_integrity_violated Then
158     -- Unique integrity has been violated
159     --
160     per_pdp_shd.constraint_error
161       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
162   When Others Then
163     --
164     Raise;
165 End update_dml;
166 --
167 -- ----------------------------------------------------------------------------
168 -- |------------------------------< pre_update >------------------------------|
169 -- ----------------------------------------------------------------------------
170 -- {Start Of Comments}
171 --
172 -- Description:
173 --   This private procedure contains any processing which is required before
174 --   the update dml.
175 --
176 -- Prerequisites:
177 --   This is an internal procedure which is called from the upd procedure.
178 --
179 -- In Parameters:
180 --   A Pl/Sql record structure.
181 --
182 -- Post Success:
183 --   Processing continues.
184 --
185 -- Post Failure:
186 --   If an error has occurred, an error message and exception wil be raised
187 --   but not handled.
188 --
189 -- Developer Implementation Notes:
190 --   Any pre-processing required before the update dml is issued should be
191 --   coded within this procedure. It is important to note that any 3rd party
192 --   maintenance should be reviewed before placing in this procedure.
193 --
194 -- Access Status:
195 --   Internal Row Handler Use Only.
196 --
197 -- {End Of Comments}
198 -- ----------------------------------------------------------------------------
199 Procedure pre_update
200   (p_rec in per_pdp_shd.g_rec_type
201   ) is
202 --
203   l_proc  varchar2(72) := g_package||'pre_update';
204 --
205 Begin
206   hr_utility.set_location('Entering:'||l_proc, 5);
207   --
208   hr_utility.set_location(' Leaving:'||l_proc, 10);
209 End pre_update;
210 --
211 -- ----------------------------------------------------------------------------
212 -- |-----------------------------< post_update >------------------------------|
213 -- ----------------------------------------------------------------------------
214 -- {Start Of Comments}
215 --
216 -- Description:
217 --   This private procedure contains any processing which is required after
218 --   the update dml.
219 --
220 -- Prerequisites:
221 --   This is an internal procedure which is called from the upd procedure.
222 --
223 -- In Parameters:
224 --   A Pl/Sql record structure.
225 --
226 -- Post Success:
227 --   Processing continues.
228 --
229 -- Post Failure:
230 --   If an error has occurred, an error message and exception will be raised
231 --   but not handled.
232 --
233 -- Developer Implementation Notes:
234 --   Any post-processing required after the update dml is issued should be
235 --   coded within this procedure. It is important to note that any 3rd party
236 --   maintenance should be reviewed before placing in this procedure.
237 --
238 -- Access Status:
239 --   Internal Row Handler Use Only.
240 --
241 -- {End Of Comments}
242 -- ----------------------------------------------------------------------------
243 Procedure post_update
244   (p_effective_date               in date
245   ,p_rec                          in per_pdp_shd.g_rec_type
246   ) is
247 --
248   l_proc  varchar2(72) := g_package||'post_update';
249 --
250 Begin
251   hr_utility.set_location('Entering:'||l_proc, 5);
252   begin
253     --
254     per_pdp_rku.after_update
255       (p_effective_date              => p_effective_date
256       ,p_object_version_number
257       => p_rec.object_version_number
258       ,p_person_id
259       => p_rec.person_id
260       ,p_date_start
261       => p_rec.date_start
262       ,p_actual_termination_date
263       => p_rec.actual_termination_date
264       ,p_projected_termination_date
265       => p_rec.projected_termination_date
266       ,p_termination_reason
267       => p_rec.termination_reason
268       ,p_attribute_category
269       => p_rec.attribute_category
270       ,p_attribute1
271       => p_rec.attribute1
272       ,p_attribute2
273       => p_rec.attribute2
274       ,p_attribute3
275       => p_rec.attribute3
276       ,p_attribute4
277       => p_rec.attribute4
278       ,p_attribute5
279       => p_rec.attribute5
280       ,p_attribute6
281       => p_rec.attribute6
282       ,p_attribute7
283       => p_rec.attribute7
284       ,p_attribute8
285       => p_rec.attribute8
286       ,p_attribute9
287       => p_rec.attribute9
288       ,p_attribute10
289       => p_rec.attribute10
290       ,p_attribute11
291       => p_rec.attribute11
292       ,p_attribute12
293       => p_rec.attribute12
294       ,p_attribute13
295       => p_rec.attribute13
296       ,p_attribute14
297       => p_rec.attribute14
298       ,p_attribute15
299       => p_rec.attribute15
300       ,p_attribute16
301       => p_rec.attribute16
302       ,p_attribute17
303       => p_rec.attribute17
304       ,p_attribute18
305       => p_rec.attribute18
306       ,p_attribute19
307       => p_rec.attribute19
308       ,p_attribute20
309       => p_rec.attribute20
310       ,p_attribute21
311       => p_rec.attribute21
312       ,p_attribute22
313       => p_rec.attribute22
314       ,p_attribute23
315       => p_rec.attribute23
316       ,p_attribute24
317       => p_rec.attribute24
318       ,p_attribute25
319       => p_rec.attribute25
320       ,p_attribute26
321       => p_rec.attribute26
322       ,p_attribute27
323       => p_rec.attribute27
324       ,p_attribute28
325       => p_rec.attribute28
326       ,p_attribute29
327       => p_rec.attribute29
328       ,p_attribute30
329       => p_rec.attribute30
330       ,p_information_category
331       => p_rec.information_category
332       ,p_information1
333       => p_rec.information1
334       ,p_information2
335       => p_rec.information2
336       ,p_information3
337       => p_rec.information3
338       ,p_information4
339       => p_rec.information4
340       ,p_information5
341       => p_rec.information5
342       ,p_information6
343       => p_rec.information6
344       ,p_information7
345       => p_rec.information7
346       ,p_information8
347       => p_rec.information8
348       ,p_information9
349       => p_rec.information9
350       ,p_information10
351       => p_rec.information10
352       ,p_information11
353       => p_rec.information11
354       ,p_information12
355       => p_rec.information12
356       ,p_information13
357       => p_rec.information13
358       ,p_information14
359       => p_rec.information14
360       ,p_information15
361       => p_rec.information15
362       ,p_information16
363       => p_rec.information16
364       ,p_information17
365       => p_rec.information17
366       ,p_information18
367       => p_rec.information18
368       ,p_information19
369       => p_rec.information19
370       ,p_information20
371       => p_rec.information20
372       ,p_information21
373       => p_rec.information21
374       ,p_information22
375       => p_rec.information22
376       ,p_information23
377       => p_rec.information23
378       ,p_information24
379       => p_rec.information24
380       ,p_information25
381       => p_rec.information25
382       ,p_information26
383       => p_rec.information26
384       ,p_information27
385       => p_rec.information27
386       ,p_information28
387       => p_rec.information28
388       ,p_information29
389       => p_rec.information29
390       ,p_information30
391       => p_rec.information30
392       ,p_final_process_date
393       => p_rec.final_process_date
394       ,p_last_standard_process_date
395       => p_rec.last_standard_process_date
396       ,p_object_version_number_o
397       => per_pdp_shd.g_old_rec.object_version_number
398       ,p_business_group_id_o
399       => per_pdp_shd.g_old_rec.business_group_id
400       ,p_person_id_o
401       => per_pdp_shd.g_old_rec.person_id
402       ,p_date_start_o
403       => per_pdp_shd.g_old_rec.date_start
404       ,p_actual_termination_date_o
405       => per_pdp_shd.g_old_rec.actual_termination_date
406       ,p_projected_termination_date_o
407       => per_pdp_shd.g_old_rec.projected_termination_date
408       ,p_termination_reason_o
409       => per_pdp_shd.g_old_rec.termination_reason
410       ,p_attribute_category_o
411       => per_pdp_shd.g_old_rec.attribute_category
412       ,p_attribute1_o
413       => per_pdp_shd.g_old_rec.attribute1
414       ,p_attribute2_o
415       => per_pdp_shd.g_old_rec.attribute2
416       ,p_attribute3_o
417       => per_pdp_shd.g_old_rec.attribute3
418       ,p_attribute4_o
419       => per_pdp_shd.g_old_rec.attribute4
420       ,p_attribute5_o
421       => per_pdp_shd.g_old_rec.attribute5
422       ,p_attribute6_o
423       => per_pdp_shd.g_old_rec.attribute6
424       ,p_attribute7_o
425       => per_pdp_shd.g_old_rec.attribute7
426       ,p_attribute8_o
427       => per_pdp_shd.g_old_rec.attribute8
428       ,p_attribute9_o
429       => per_pdp_shd.g_old_rec.attribute9
430       ,p_attribute10_o
431       => per_pdp_shd.g_old_rec.attribute10
432       ,p_attribute11_o
433       => per_pdp_shd.g_old_rec.attribute11
434       ,p_attribute12_o
435       => per_pdp_shd.g_old_rec.attribute12
436       ,p_attribute13_o
437       => per_pdp_shd.g_old_rec.attribute13
438       ,p_attribute14_o
439       => per_pdp_shd.g_old_rec.attribute14
440       ,p_attribute15_o
441       => per_pdp_shd.g_old_rec.attribute15
442       ,p_attribute16_o
443       => per_pdp_shd.g_old_rec.attribute16
444       ,p_attribute17_o
445       => per_pdp_shd.g_old_rec.attribute17
446       ,p_attribute18_o
447       => per_pdp_shd.g_old_rec.attribute18
448       ,p_attribute19_o
449       => per_pdp_shd.g_old_rec.attribute19
450       ,p_attribute20_o
451       => per_pdp_shd.g_old_rec.attribute20
452       ,p_attribute21_o
453       => per_pdp_shd.g_old_rec.attribute21
454       ,p_attribute22_o
455       => per_pdp_shd.g_old_rec.attribute22
456       ,p_attribute23_o
457       => per_pdp_shd.g_old_rec.attribute23
458       ,p_attribute24_o
459       => per_pdp_shd.g_old_rec.attribute24
460       ,p_attribute25_o
461       => per_pdp_shd.g_old_rec.attribute25
462       ,p_attribute26_o
463       => per_pdp_shd.g_old_rec.attribute26
464       ,p_attribute27_o
465       => per_pdp_shd.g_old_rec.attribute27
466       ,p_attribute28_o
467       => per_pdp_shd.g_old_rec.attribute28
468       ,p_attribute29_o
469       => per_pdp_shd.g_old_rec.attribute29
470       ,p_attribute30_o
471       => per_pdp_shd.g_old_rec.attribute30
472       ,p_information_category_o
473       => per_pdp_shd.g_old_rec.information_category
474       ,p_information1_o
475       => per_pdp_shd.g_old_rec.information1
476       ,p_information2_o
477       => per_pdp_shd.g_old_rec.information2
478       ,p_information3_o
479       => per_pdp_shd.g_old_rec.information3
480       ,p_information4_o
481       => per_pdp_shd.g_old_rec.information4
482       ,p_information5_o
483       => per_pdp_shd.g_old_rec.information5
484       ,p_information6_o
485       => per_pdp_shd.g_old_rec.information6
486       ,p_information7_o
487       => per_pdp_shd.g_old_rec.information7
488       ,p_information8_o
489       => per_pdp_shd.g_old_rec.information8
490       ,p_information9_o
491       => per_pdp_shd.g_old_rec.information9
492       ,p_information10_o
493       => per_pdp_shd.g_old_rec.information10
494       ,p_information11_o
495       => per_pdp_shd.g_old_rec.information11
496       ,p_information12_o
497       => per_pdp_shd.g_old_rec.information12
498       ,p_information13_o
499       => per_pdp_shd.g_old_rec.information13
500       ,p_information14_o
501       => per_pdp_shd.g_old_rec.information14
502       ,p_information15_o
503       => per_pdp_shd.g_old_rec.information15
504       ,p_information16_o
505       => per_pdp_shd.g_old_rec.information16
506       ,p_information17_o
507       => per_pdp_shd.g_old_rec.information17
508       ,p_information18_o
509       => per_pdp_shd.g_old_rec.information18
510       ,p_information19_o
511       => per_pdp_shd.g_old_rec.information19
512       ,p_information20_o
513       => per_pdp_shd.g_old_rec.information20
514       ,p_information21_o
515       => per_pdp_shd.g_old_rec.information21
516       ,p_information22_o
517       => per_pdp_shd.g_old_rec.information22
518       ,p_information23_o
519       => per_pdp_shd.g_old_rec.information23
520       ,p_information24_o
521       => per_pdp_shd.g_old_rec.information24
522       ,p_information25_o
523       => per_pdp_shd.g_old_rec.information25
524       ,p_information26_o
525       => per_pdp_shd.g_old_rec.information26
526       ,p_information27_o
527       => per_pdp_shd.g_old_rec.information27
528       ,p_information28_o
529       => per_pdp_shd.g_old_rec.information28
530       ,p_information29_o
531       => per_pdp_shd.g_old_rec.information29
532       ,p_information30_o
533       => per_pdp_shd.g_old_rec.information30
534       ,p_final_process_date_o
535       => per_pdp_shd.g_old_rec.final_process_date
536       ,p_last_standard_process_date_o
537       => per_pdp_shd.g_old_rec.last_standard_process_date
538       );
539     --
540   exception
541     --
542     when hr_api.cannot_find_prog_unit then
543       --
544       hr_api.cannot_find_prog_unit_error
545         (p_module_name => 'PER_PERIODS_OF_PLACEMENT'
546         ,p_hook_type   => 'AU');
547       --
548   end;
549   --
550   hr_utility.set_location(' Leaving:'||l_proc, 10);
551 End post_update;
552 --
553 -- ----------------------------------------------------------------------------
554 -- |-----------------------------< convert_defs >-----------------------------|
555 -- ----------------------------------------------------------------------------
556 -- {Start Of Comments}
557 --
558 -- Description:
559 --   The Convert_Defs procedure has one very important function:
560 --   It must return the record structure for the row with all system defaulted
561 --   values converted into its corresponding parameter value for update. When
562 --   we attempt to update a row through the Upd process , certain
563 --   parameters can be defaulted which enables flexibility in the calling of
564 --   the upd process (e.g. only attributes which need to be updated need to be
565 --   specified). For the upd process to determine which attributes
566 --   have NOT been specified we need to check if the parameter has a reserved
567 --   system default value. Therefore, for all parameters which have a
568 --   corresponding reserved system default mechanism specified we need to
569 --   check if a system default is being used. If a system default is being
570 --   used then we convert the defaulted value into its corresponding attribute
571 --   value held in the g_old_rec data structure.
572 --
573 -- Prerequisites:
574 --   This private function can only be called from the upd process.
575 --
576 -- In Parameters:
577 --   A Pl/Sql record structure.
578 --
579 -- Post Success:
580 --   The record structure will be returned with all system defaulted parameter
581 --   values converted into its current row attribute value.
582 --
583 -- Post Failure:
584 --   No direct error handling is required within this function. Any possible
585 --   errors within this procedure will be a PL/SQL value error due to
586 --   conversion of datatypes or data lengths.
587 --
588 -- Developer Implementation Notes:
589 --   None.
590 --
591 -- Access Status:
592 --   Internal Row Handler Use Only.
593 --
594 -- {End Of Comments}
595 -- ----------------------------------------------------------------------------
596 Procedure convert_defs
597   (p_rec in out nocopy per_pdp_shd.g_rec_type
598   ) is
599 --
600 Begin
601   --
602   -- We must now examine each argument value in the
603   -- p_rec plsql record structure
604   -- to see if a system default is being used. If a system default
605   -- is being used then we must set to the 'current' argument value.
606   --
607   If (p_rec.business_group_id = hr_api.g_number) then
608     p_rec.business_group_id :=
609     per_pdp_shd.g_old_rec.business_group_id;
610   End If;
611   If (p_rec.person_id = hr_api.g_number) then
612     p_rec.person_id :=
613     per_pdp_shd.g_old_rec.person_id;
614   End If;
615   If (p_rec.date_start = hr_api.g_date) then
616     p_rec.date_start :=
617     per_pdp_shd.g_old_rec.date_start;
618   End If;
619   If (p_rec.actual_termination_date = hr_api.g_date) then
620     p_rec.actual_termination_date :=
621     per_pdp_shd.g_old_rec.actual_termination_date;
622   End If;
623   If (p_rec.projected_termination_date = hr_api.g_date) then
624     p_rec.projected_termination_date :=
625     per_pdp_shd.g_old_rec.projected_termination_date;
626   End If;
627   If (p_rec.termination_reason = hr_api.g_varchar2) then
628     p_rec.termination_reason :=
629     per_pdp_shd.g_old_rec.termination_reason;
630   End If;
631   If (p_rec.attribute_category = hr_api.g_varchar2) then
632     p_rec.attribute_category :=
633     per_pdp_shd.g_old_rec.attribute_category;
634   End If;
635   If (p_rec.attribute1 = hr_api.g_varchar2) then
636     p_rec.attribute1 :=
637     per_pdp_shd.g_old_rec.attribute1;
638   End If;
639   If (p_rec.attribute2 = hr_api.g_varchar2) then
640     p_rec.attribute2 :=
641     per_pdp_shd.g_old_rec.attribute2;
642   End If;
643   If (p_rec.attribute3 = hr_api.g_varchar2) then
644     p_rec.attribute3 :=
645     per_pdp_shd.g_old_rec.attribute3;
646   End If;
647   If (p_rec.attribute4 = hr_api.g_varchar2) then
648     p_rec.attribute4 :=
649     per_pdp_shd.g_old_rec.attribute4;
650   End If;
651   If (p_rec.attribute5 = hr_api.g_varchar2) then
652     p_rec.attribute5 :=
653     per_pdp_shd.g_old_rec.attribute5;
654   End If;
655   If (p_rec.attribute6 = hr_api.g_varchar2) then
656     p_rec.attribute6 :=
657     per_pdp_shd.g_old_rec.attribute6;
658   End If;
659   If (p_rec.attribute7 = hr_api.g_varchar2) then
660     p_rec.attribute7 :=
661     per_pdp_shd.g_old_rec.attribute7;
662   End If;
663   If (p_rec.attribute8 = hr_api.g_varchar2) then
664     p_rec.attribute8 :=
665     per_pdp_shd.g_old_rec.attribute8;
666   End If;
667   If (p_rec.attribute9 = hr_api.g_varchar2) then
668     p_rec.attribute9 :=
669     per_pdp_shd.g_old_rec.attribute9;
670   End If;
671   If (p_rec.attribute10 = hr_api.g_varchar2) then
672     p_rec.attribute10 :=
673     per_pdp_shd.g_old_rec.attribute10;
674   End If;
675   If (p_rec.attribute11 = hr_api.g_varchar2) then
676     p_rec.attribute11 :=
677     per_pdp_shd.g_old_rec.attribute11;
678   End If;
679   If (p_rec.attribute12 = hr_api.g_varchar2) then
680     p_rec.attribute12 :=
681     per_pdp_shd.g_old_rec.attribute12;
682   End If;
683   If (p_rec.attribute13 = hr_api.g_varchar2) then
684     p_rec.attribute13 :=
685     per_pdp_shd.g_old_rec.attribute13;
686   End If;
687   If (p_rec.attribute14 = hr_api.g_varchar2) then
688     p_rec.attribute14 :=
689     per_pdp_shd.g_old_rec.attribute14;
690   End If;
691   If (p_rec.attribute15 = hr_api.g_varchar2) then
692     p_rec.attribute15 :=
693     per_pdp_shd.g_old_rec.attribute15;
694   End If;
695   If (p_rec.attribute16 = hr_api.g_varchar2) then
696     p_rec.attribute16 :=
697     per_pdp_shd.g_old_rec.attribute16;
698   End If;
699   If (p_rec.attribute17 = hr_api.g_varchar2) then
700     p_rec.attribute17 :=
701     per_pdp_shd.g_old_rec.attribute17;
702   End If;
703   If (p_rec.attribute18 = hr_api.g_varchar2) then
704     p_rec.attribute18 :=
705     per_pdp_shd.g_old_rec.attribute18;
706   End If;
707   If (p_rec.attribute19 = hr_api.g_varchar2) then
708     p_rec.attribute19 :=
709     per_pdp_shd.g_old_rec.attribute19;
710   End If;
711   If (p_rec.attribute20 = hr_api.g_varchar2) then
712     p_rec.attribute20 :=
713     per_pdp_shd.g_old_rec.attribute20;
714   End If;
715   If (p_rec.attribute21 = hr_api.g_varchar2) then
716     p_rec.attribute21 :=
717     per_pdp_shd.g_old_rec.attribute21;
718   End If;
719   If (p_rec.attribute22 = hr_api.g_varchar2) then
720     p_rec.attribute22 :=
721     per_pdp_shd.g_old_rec.attribute22;
722   End If;
723   If (p_rec.attribute23 = hr_api.g_varchar2) then
724     p_rec.attribute23 :=
725     per_pdp_shd.g_old_rec.attribute23;
726   End If;
727   If (p_rec.attribute24 = hr_api.g_varchar2) then
728     p_rec.attribute24 :=
729     per_pdp_shd.g_old_rec.attribute24;
730   End If;
731   If (p_rec.attribute25 = hr_api.g_varchar2) then
732     p_rec.attribute25 :=
733     per_pdp_shd.g_old_rec.attribute25;
734   End If;
735   If (p_rec.attribute26 = hr_api.g_varchar2) then
736     p_rec.attribute26 :=
737     per_pdp_shd.g_old_rec.attribute26;
738   End If;
739   If (p_rec.attribute27 = hr_api.g_varchar2) then
740     p_rec.attribute27 :=
741     per_pdp_shd.g_old_rec.attribute27;
742   End If;
743   If (p_rec.attribute28 = hr_api.g_varchar2) then
744     p_rec.attribute28 :=
745     per_pdp_shd.g_old_rec.attribute28;
746   End If;
747   If (p_rec.attribute29 = hr_api.g_varchar2) then
748     p_rec.attribute29 :=
749     per_pdp_shd.g_old_rec.attribute29;
750   End If;
751   If (p_rec.attribute30 = hr_api.g_varchar2) then
752     p_rec.attribute30 :=
753     per_pdp_shd.g_old_rec.attribute30;
754   End If;
755   If (p_rec.information_category = hr_api.g_varchar2) then
756     p_rec.information_category :=
757     per_pdp_shd.g_old_rec.information_category;
758   End If;
759   If (p_rec.information1 = hr_api.g_varchar2) then
760     p_rec.information1 :=
761     per_pdp_shd.g_old_rec.information1;
762   End If;
763   If (p_rec.information2 = hr_api.g_varchar2) then
764     p_rec.information2 :=
765     per_pdp_shd.g_old_rec.information2;
766   End If;
767   If (p_rec.information3 = hr_api.g_varchar2) then
768     p_rec.information3 :=
769     per_pdp_shd.g_old_rec.information3;
770   End If;
771   If (p_rec.information4 = hr_api.g_varchar2) then
772     p_rec.information4 :=
773     per_pdp_shd.g_old_rec.information4;
774   End If;
775   If (p_rec.information5 = hr_api.g_varchar2) then
776     p_rec.information5 :=
777     per_pdp_shd.g_old_rec.information5;
778   End If;
779   If (p_rec.information6 = hr_api.g_varchar2) then
780     p_rec.information6 :=
781     per_pdp_shd.g_old_rec.information6;
782   End If;
783   If (p_rec.information7 = hr_api.g_varchar2) then
784     p_rec.information7 :=
785     per_pdp_shd.g_old_rec.information7;
786   End If;
787   If (p_rec.information8 = hr_api.g_varchar2) then
788     p_rec.information8 :=
789     per_pdp_shd.g_old_rec.information8;
790   End If;
791   If (p_rec.information9 = hr_api.g_varchar2) then
792     p_rec.information9 :=
793     per_pdp_shd.g_old_rec.information9;
794   End If;
795   If (p_rec.information10 = hr_api.g_varchar2) then
796     p_rec.information10 :=
797     per_pdp_shd.g_old_rec.information10;
798   End If;
799   If (p_rec.information11 = hr_api.g_varchar2) then
800     p_rec.information11 :=
801     per_pdp_shd.g_old_rec.information11;
802   End If;
803   If (p_rec.information12 = hr_api.g_varchar2) then
804     p_rec.information12 :=
805     per_pdp_shd.g_old_rec.information12;
806   End If;
807   If (p_rec.information13 = hr_api.g_varchar2) then
808     p_rec.information13 :=
809     per_pdp_shd.g_old_rec.information13;
810   End If;
811   If (p_rec.information14 = hr_api.g_varchar2) then
812     p_rec.information14 :=
813     per_pdp_shd.g_old_rec.information14;
814   End If;
815   If (p_rec.information15 = hr_api.g_varchar2) then
816     p_rec.information15 :=
817     per_pdp_shd.g_old_rec.information15;
818   End If;
819   If (p_rec.information16 = hr_api.g_varchar2) then
820     p_rec.information16 :=
821     per_pdp_shd.g_old_rec.information16;
822   End If;
823   If (p_rec.information17 = hr_api.g_varchar2) then
824     p_rec.information17 :=
825     per_pdp_shd.g_old_rec.information17;
826   End If;
827   If (p_rec.information18 = hr_api.g_varchar2) then
828     p_rec.information18 :=
829     per_pdp_shd.g_old_rec.information18;
830   End If;
831   If (p_rec.information19 = hr_api.g_varchar2) then
832     p_rec.information19 :=
833     per_pdp_shd.g_old_rec.information19;
834   End If;
835   If (p_rec.information20 = hr_api.g_varchar2) then
836     p_rec.information20 :=
837     per_pdp_shd.g_old_rec.information20;
838   End If;
839   If (p_rec.information21 = hr_api.g_varchar2) then
840     p_rec.information21 :=
841     per_pdp_shd.g_old_rec.information21;
842   End If;
843   If (p_rec.information22 = hr_api.g_varchar2) then
844     p_rec.information22 :=
845     per_pdp_shd.g_old_rec.information22;
846   End If;
847   If (p_rec.information23 = hr_api.g_varchar2) then
848     p_rec.information23 :=
849     per_pdp_shd.g_old_rec.information23;
850   End If;
851   If (p_rec.information24 = hr_api.g_varchar2) then
852     p_rec.information24 :=
853     per_pdp_shd.g_old_rec.information24;
854   End If;
855   If (p_rec.information25 = hr_api.g_varchar2) then
856     p_rec.information25 :=
857     per_pdp_shd.g_old_rec.information25;
858   End If;
859   If (p_rec.information26 = hr_api.g_varchar2) then
860     p_rec.information26 :=
861     per_pdp_shd.g_old_rec.information26;
862   End If;
863   If (p_rec.information27 = hr_api.g_varchar2) then
864     p_rec.information27 :=
865     per_pdp_shd.g_old_rec.information27;
866   End If;
867   If (p_rec.information28 = hr_api.g_varchar2) then
868     p_rec.information28 :=
869     per_pdp_shd.g_old_rec.information28;
870   End If;
871   If (p_rec.information29 = hr_api.g_varchar2) then
872     p_rec.information29 :=
873     per_pdp_shd.g_old_rec.information29;
874   End If;
875   If (p_rec.information30 = hr_api.g_varchar2) then
876     p_rec.information30 :=
877     per_pdp_shd.g_old_rec.information30;
878   End If;
879   If (p_rec.final_process_date = hr_api.g_date) then
880     p_rec.final_process_date :=
881     per_pdp_shd.g_old_rec.final_process_date;
882   End If;
883   If (p_rec.last_standard_process_date = hr_api.g_date) then
884     p_rec.last_standard_process_date :=
885     per_pdp_shd.g_old_rec.last_standard_process_date;
886   End If;
887   --
888 End convert_defs;
889 --
890 -- ----------------------------------------------------------------------------
891 -- |---------------------------------< upd >----------------------------------|
892 -- ----------------------------------------------------------------------------
893 Procedure upd
894   (p_effective_date               in date
895   ,p_rec                          in out nocopy per_pdp_shd.g_rec_type
896   ) is
897 --
898   l_proc  varchar2(72) := g_package||'upd';
899 --
900 Begin
901   hr_utility.set_location('Entering:'||l_proc, 5);
902   --
903   -- We must lock the row which we need to update.
904   --
905   per_pdp_shd.lck
906     (p_rec.period_of_placement_id
907     ,p_rec.object_version_number
908     );
909   --
910   -- 1. During an update system defaults are used to determine if
911   --    arguments have been defaulted or not. We must therefore
912   --    derive the full record structure values to be updated.
913   --
914   -- 2. Call the supporting update validate operations.
915   --
916   convert_defs(p_rec);
917   per_pdp_bus.update_validate
918      (p_effective_date
919      ,p_rec
920      );
921   --
922   -- Call to raise any errors on multi-message list
923   hr_multi_message.end_validation_set;
924   --
925   -- Call the supporting pre-update operation
926   --
927   per_pdp_upd.pre_update(p_rec);
928   --
929   -- Update the row.
930   --
931   per_pdp_upd.update_dml(p_rec);
932   --
933   -- Call the supporting post-update operation
934   --
935   per_pdp_upd.post_update
936      (p_effective_date
937      ,p_rec
938      );
939   --
940   -- Call to raise any errors on multi-message list
941   hr_multi_message.end_validation_set;
942 End upd;
943 --
944 -- ----------------------------------------------------------------------------
945 -- |---------------------------------< upd >----------------------------------|
946 -- ----------------------------------------------------------------------------
947 Procedure upd
948   (p_effective_date               in     date
949   ,p_object_version_number        in out nocopy number
950   ,p_person_id                    in     number
951   ,p_date_start                   in     date
952   ,p_actual_termination_date      in     date      default hr_api.g_date
953   ,p_projected_termination_date   in     date      default hr_api.g_date
954   ,p_termination_reason           in     varchar2  default hr_api.g_varchar2
955   ,p_attribute_category           in     varchar2  default hr_api.g_varchar2
956   ,p_attribute1                   in     varchar2  default hr_api.g_varchar2
957   ,p_attribute2                   in     varchar2  default hr_api.g_varchar2
958   ,p_attribute3                   in     varchar2  default hr_api.g_varchar2
959   ,p_attribute4                   in     varchar2  default hr_api.g_varchar2
960   ,p_attribute5                   in     varchar2  default hr_api.g_varchar2
961   ,p_attribute6                   in     varchar2  default hr_api.g_varchar2
962   ,p_attribute7                   in     varchar2  default hr_api.g_varchar2
963   ,p_attribute8                   in     varchar2  default hr_api.g_varchar2
964   ,p_attribute9                   in     varchar2  default hr_api.g_varchar2
965   ,p_attribute10                  in     varchar2  default hr_api.g_varchar2
966   ,p_attribute11                  in     varchar2  default hr_api.g_varchar2
967   ,p_attribute12                  in     varchar2  default hr_api.g_varchar2
968   ,p_attribute13                  in     varchar2  default hr_api.g_varchar2
969   ,p_attribute14                  in     varchar2  default hr_api.g_varchar2
970   ,p_attribute15                  in     varchar2  default hr_api.g_varchar2
971   ,p_attribute16                  in     varchar2  default hr_api.g_varchar2
972   ,p_attribute17                  in     varchar2  default hr_api.g_varchar2
973   ,p_attribute18                  in     varchar2  default hr_api.g_varchar2
974   ,p_attribute19                  in     varchar2  default hr_api.g_varchar2
975   ,p_attribute20                  in     varchar2  default hr_api.g_varchar2
976   ,p_attribute21                  in     varchar2  default hr_api.g_varchar2
977   ,p_attribute22                  in     varchar2  default hr_api.g_varchar2
978   ,p_attribute23                  in     varchar2  default hr_api.g_varchar2
979   ,p_attribute24                  in     varchar2  default hr_api.g_varchar2
980   ,p_attribute25                  in     varchar2  default hr_api.g_varchar2
981   ,p_attribute26                  in     varchar2  default hr_api.g_varchar2
982   ,p_attribute27                  in     varchar2  default hr_api.g_varchar2
983   ,p_attribute28                  in     varchar2  default hr_api.g_varchar2
984   ,p_attribute29                  in     varchar2  default hr_api.g_varchar2
985   ,p_attribute30                  in     varchar2  default hr_api.g_varchar2
986   ,p_information_category         in     varchar2  default hr_api.g_varchar2
987   ,p_information1                 in     varchar2  default hr_api.g_varchar2
988   ,p_information2                 in     varchar2  default hr_api.g_varchar2
989   ,p_information3                 in     varchar2  default hr_api.g_varchar2
990   ,p_information4                 in     varchar2  default hr_api.g_varchar2
991   ,p_information5                 in     varchar2  default hr_api.g_varchar2
992   ,p_information6                 in     varchar2  default hr_api.g_varchar2
993   ,p_information7                 in     varchar2  default hr_api.g_varchar2
994   ,p_information8                 in     varchar2  default hr_api.g_varchar2
995   ,p_information9                 in     varchar2  default hr_api.g_varchar2
996   ,p_information10                in     varchar2  default hr_api.g_varchar2
997   ,p_information11                in     varchar2  default hr_api.g_varchar2
998   ,p_information12                in     varchar2  default hr_api.g_varchar2
999   ,p_information13                in     varchar2  default hr_api.g_varchar2
1000   ,p_information14                in     varchar2  default hr_api.g_varchar2
1001   ,p_information15                in     varchar2  default hr_api.g_varchar2
1002   ,p_information16                in     varchar2  default hr_api.g_varchar2
1003   ,p_information17                in     varchar2  default hr_api.g_varchar2
1004   ,p_information18                in     varchar2  default hr_api.g_varchar2
1005   ,p_information19                in     varchar2  default hr_api.g_varchar2
1006   ,p_information20                in     varchar2  default hr_api.g_varchar2
1007   ,p_information21                in     varchar2  default hr_api.g_varchar2
1008   ,p_information22                in     varchar2  default hr_api.g_varchar2
1009   ,p_information23                in     varchar2  default hr_api.g_varchar2
1010   ,p_information24                in     varchar2  default hr_api.g_varchar2
1011   ,p_information25                in     varchar2  default hr_api.g_varchar2
1012   ,p_information26                in     varchar2  default hr_api.g_varchar2
1013   ,p_information27                in     varchar2  default hr_api.g_varchar2
1014   ,p_information28                in     varchar2  default hr_api.g_varchar2
1015   ,p_information29                in     varchar2  default hr_api.g_varchar2
1016   ,p_information30                in     varchar2  default hr_api.g_varchar2
1017   ,p_final_process_date           in     date      default hr_api.g_date
1018   ,p_last_standard_process_date   in     date      default hr_api.g_date
1019   ) is
1020 --
1021 
1022   l_rec   per_pdp_shd.g_rec_type;
1023   l_proc  varchar2(72) := g_package||'upd';
1024   l_period_of_placement_id  number;
1025 
1026 --
1027 Begin
1028   hr_utility.set_location('Entering:'||l_proc, 5);
1029 
1030   --
1031   -- The sequence key period_of_placement_id is hidden from the user
1032   -- because they should be using the user key person_id and date_start.
1033   -- To prevent confusion, period_of_placement_id is not passed in upd
1034   -- so is instead queried from the database.
1035   --
1036   l_period_of_placement_id := per_pdp_bus.return_period_of_placement_id
1037     (p_person_id            => p_person_id
1038     ,p_date_start           => p_date_start);
1039 
1040   hr_utility.trace ('period_of_placement_id: '
1041                    ||to_char(l_period_of_placement_id));
1042 
1043   l_rec :=
1044   per_pdp_shd.convert_args
1045   (p_object_version_number
1046   ,hr_api.g_number
1047   ,p_person_id
1048    ,p_date_start
1049    ,p_actual_termination_date
1050    ,p_projected_termination_date
1051    ,p_termination_reason
1052    ,p_attribute_category
1053    ,p_attribute1
1054    ,p_attribute2
1055    ,p_attribute3
1056    ,p_attribute4
1057    ,p_attribute5
1058    ,p_attribute6
1059    ,p_attribute7
1060    ,p_attribute8
1061    ,p_attribute9
1062    ,p_attribute10
1063    ,p_attribute11
1064    ,p_attribute12
1065    ,p_attribute13
1066    ,p_attribute14
1067    ,p_attribute15
1068    ,p_attribute16
1069    ,p_attribute17
1070    ,p_attribute18
1071    ,p_attribute19
1072    ,p_attribute20
1073    ,p_attribute21
1074    ,p_attribute22
1075    ,p_attribute23
1076    ,p_attribute24
1077    ,p_attribute25
1078    ,p_attribute26
1079    ,p_attribute27
1080    ,p_attribute28
1081    ,p_attribute29
1082    ,p_attribute30
1083    ,p_information_category
1084    ,p_information1
1085    ,p_information2
1086    ,p_information3
1087    ,p_information4
1088    ,p_information5
1089    ,p_information6
1090    ,p_information7
1091    ,p_information8
1092    ,p_information9
1093    ,p_information10
1094    ,p_information11
1095    ,p_information12
1096    ,p_information13
1097    ,p_information14
1098    ,p_information15
1099    ,p_information16
1100    ,p_information17
1101    ,p_information18
1102    ,p_information19
1103    ,p_information20
1104    ,p_information21
1105    ,p_information22
1106    ,p_information23
1107    ,p_information24
1108    ,p_information25
1109    ,p_information26
1110    ,p_information27
1111    ,p_information28
1112    ,p_information29
1113    ,p_information30
1114    ,l_period_of_placement_id
1115    ,p_final_process_date
1116    ,p_last_standard_process_date
1117    );
1118 
1119    --
1120    -- Having converted the arguments into the
1121    -- plsql record structure we call the corresponding record
1122    -- business process.
1123    --
1124    per_pdp_upd.upd
1125       (p_effective_date
1126       ,l_rec
1127       );
1128 
1129    p_object_version_number := l_rec.object_version_number;
1130 
1131   hr_utility.set_location(' Leaving:'||l_proc, 10);
1132 End upd;
1133 --
1134 end per_pdp_upd;