DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PGH_UPD

Source


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