DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PGN_UPD

Source


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