DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_ROL_UPD

Source


1 Package Body per_rol_upd as
2 /* $Header: perolrhi.pkb 120.0 2005/05/31 18:34:51 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_rol_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_rol_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_roles Row
69   --
70   update per_roles
71     set
72      role_id                         = p_rec.role_id
73     ,job_id                          = p_rec.job_id
74     ,job_group_id                    = p_rec.job_group_id
75     ,person_id                       = p_rec.person_id
76     ,organization_id                 = p_rec.organization_id
77     ,start_date                      = p_rec.start_date
78     ,end_date                        = p_rec.end_date
79     ,confidential_date               = p_rec.confidential_date
80     ,emp_rights_flag                 = p_rec.emp_rights_flag
81     ,end_of_rights_date              = p_rec.end_of_rights_date
82     ,primary_contact_flag            = p_rec.primary_contact_flag
83     ,attribute_category              = p_rec.attribute_category
84     ,attribute1                      = p_rec.attribute1
85     ,attribute2                      = p_rec.attribute2
86     ,attribute3                      = p_rec.attribute3
87     ,attribute4                      = p_rec.attribute4
88     ,attribute5                      = p_rec.attribute5
89     ,attribute6                      = p_rec.attribute6
90     ,attribute7                      = p_rec.attribute7
91     ,attribute8                      = p_rec.attribute8
92     ,attribute9                      = p_rec.attribute9
93     ,attribute10                     = p_rec.attribute10
94     ,attribute11                     = p_rec.attribute11
95     ,attribute12                     = p_rec.attribute12
96     ,attribute13                     = p_rec.attribute13
97     ,attribute14                     = p_rec.attribute14
98     ,attribute15                     = p_rec.attribute15
99     ,attribute16                     = p_rec.attribute16
100     ,attribute17                     = p_rec.attribute17
101     ,attribute18                     = p_rec.attribute18
102     ,attribute19                     = p_rec.attribute19
103     ,attribute20                     = p_rec.attribute20
104     ,role_information_category       = p_rec.role_information_category
105     ,role_information1               = p_rec.role_information1
106     ,role_information2               = p_rec.role_information2
107     ,role_information3               = p_rec.role_information3
108     ,role_information4               = p_rec.role_information4
109     ,role_information5               = p_rec.role_information5
110     ,role_information6               = p_rec.role_information6
111     ,role_information7               = p_rec.role_information7
112     ,role_information8               = p_rec.role_information8
113     ,role_information9               = p_rec.role_information9
114     ,role_information10              = p_rec.role_information10
115     ,role_information11              = p_rec.role_information11
116     ,role_information12              = p_rec.role_information12
117     ,role_information13              = p_rec.role_information13
118     ,role_information14              = p_rec.role_information14
119     ,role_information15              = p_rec.role_information15
120     ,role_information16              = p_rec.role_information16
121     ,role_information17              = p_rec.role_information17
122     ,role_information18              = p_rec.role_information18
123     ,role_information19              = p_rec.role_information19
124     ,role_information20              = p_rec.role_information20
125     ,object_version_number           = p_rec.object_version_number
126     ,old_end_date                    = p_rec.old_end_date -- fix 1370960
127     where role_id = p_rec.role_id;
128   --
129   --
130   --
131   hr_utility.set_location(' Leaving:'||l_proc, 10);
132 --
133 Exception
134   When hr_api.check_integrity_violated Then
135     -- A check constraint has been violated
136     --
137     per_rol_shd.constraint_error
138       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
139   When hr_api.parent_integrity_violated Then
140     -- Parent integrity has been violated
141     --
142     per_rol_shd.constraint_error
143       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
144   When hr_api.unique_integrity_violated Then
145     -- Unique integrity has been violated
146     --
147     per_rol_shd.constraint_error
148       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
149   When Others Then
150     --
151     Raise;
152 End update_dml;
153 --
154 -- ----------------------------------------------------------------------------
155 -- |------------------------------< pre_update >------------------------------|
156 -- ----------------------------------------------------------------------------
157 -- {Start Of Comments}
158 --
159 -- Description:
160 --   This private procedure contains any processing which is required before
161 --   the update dml.
162 --
163 -- Prerequisites:
164 --   This is an internal procedure which is called from the upd procedure.
165 --
166 -- In Parameters:
167 --   A Pl/Sql record structure.
168 --
169 -- Post Success:
170 --   Processing continues.
171 --
172 -- Post Failure:
173 --   If an error has occurred, an error message and exception wil be raised
174 --   but not handled.
175 --
176 -- Developer Implementation Notes:
177 --   Any pre-processing required before the update dml is issued should be
178 --   coded within this procedure. It is important to note that any 3rd party
179 --   maintenance should be reviewed before placing in this procedure.
180 --
181 -- Access Status:
182 --   Internal Row Handler Use Only.
183 --
184 -- {End Of Comments}
185 -- ----------------------------------------------------------------------------
186 Procedure pre_update
187   (p_rec in per_rol_shd.g_rec_type
188   ) is
189 --
190   l_proc  varchar2(72) := g_package||'pre_update';
191 --
192 Begin
193   hr_utility.set_location('Entering:'||l_proc, 5);
194   --
195   hr_utility.set_location(' Leaving:'||l_proc, 10);
196 End pre_update;
197 --
198 -- ----------------------------------------------------------------------------
199 -- |-----------------------------< post_update >------------------------------|
200 -- ----------------------------------------------------------------------------
201 -- {Start Of Comments}
202 --
203 -- Description:
204 --   This private procedure contains any processing which is required after the
205 --   update dml.
206 --
207 -- Prerequisites:
208 --   This is an internal procedure which is called from the upd procedure.
209 --
210 -- In Parameters:
211 --   A Pl/Sql record structure.
212 --
213 -- Post Success:
214 --   Processing continues.
215 --
216 -- Post Failure:
217 --   If an error has occurred, an error message and exception will be raised
218 --   but not handled.
219 --
220 -- Developer Implementation Notes:
221 --   Any post-processing required after the update dml is issued should be
222 --   coded within this procedure. It is important to note that any 3rd party
223 --   maintenance should be reviewed before placing in this procedure.
224 --
225 -- Access Status:
226 --   Internal Row Handler Use Only.
227 --
228 -- {End Of Comments}
229 -- ----------------------------------------------------------------------------
230 Procedure post_update
231   (p_effective_date               in date
232   ,p_rec                          in per_rol_shd.g_rec_type
233   ) is
234 --
235   l_proc  varchar2(72) := g_package||'post_update';
236 --
237 Begin
238   hr_utility.set_location('Entering:'||l_proc, 5);
239   begin
240     --
241     per_rol_rku.after_update
242       (p_effective_date
243     => p_effective_date
244       ,p_role_id
245       => p_rec.role_id
246     ,p_job_id
247     => p_rec.job_id
248     ,p_job_group_id
249     => p_rec.job_group_id
250     ,p_person_id
251     => p_rec.person_id
252     ,p_organization_id
253     => p_rec.organization_id
254       ,p_start_date
255       => p_rec.start_date
256       ,p_end_date
257       => p_rec.end_date
258       ,p_confidential_date
259       => p_rec.confidential_date
260       ,p_emp_rights_flag
261       => p_rec.emp_rights_flag
262       ,p_end_of_rights_date
263       => p_rec.end_of_rights_date
264       ,p_primary_contact_flag
265       => p_rec.primary_contact_flag
266       ,p_attribute_category
267       => p_rec.attribute_category
268       ,p_attribute1
269       => p_rec.attribute1
270       ,p_attribute2
271       => p_rec.attribute2
272       ,p_attribute3
273       => p_rec.attribute3
274       ,p_attribute4
275       => p_rec.attribute4
276       ,p_attribute5
277       => p_rec.attribute5
278       ,p_attribute6
279       => p_rec.attribute6
280       ,p_attribute7
281       => p_rec.attribute7
282       ,p_attribute8
283       => p_rec.attribute8
284       ,p_attribute9
285       => p_rec.attribute9
286       ,p_attribute10
287       => p_rec.attribute10
288       ,p_attribute11
289       => p_rec.attribute11
290       ,p_attribute12
291       => p_rec.attribute12
292       ,p_attribute13
293       => p_rec.attribute13
294       ,p_attribute14
295       => p_rec.attribute14
296       ,p_attribute15
297       => p_rec.attribute15
298       ,p_attribute16
299       => p_rec.attribute16
300       ,p_attribute17
301       => p_rec.attribute17
302       ,p_attribute18
303       => p_rec.attribute18
304       ,p_attribute19
305       => p_rec.attribute19
306       ,p_attribute20
307       => p_rec.attribute20
308       ,p_role_information_category
309       => p_rec.role_information_category
310       ,p_role_information1
311       => p_rec.role_information1
312       ,p_role_information2
313       => p_rec.role_information2
314       ,p_role_information3
315       => p_rec.role_information3
316       ,p_role_information4
317       => p_rec.role_information4
318       ,p_role_information5
319       => p_rec.role_information5
320       ,p_role_information6
321       => p_rec.role_information6
322       ,p_role_information7
323       => p_rec.role_information7
324       ,p_role_information8
325       => p_rec.role_information8
326       ,p_role_information9
327       => p_rec.role_information9
328       ,p_role_information10
329       => p_rec.role_information10
330       ,p_role_information11
331       => p_rec.role_information11
332       ,p_role_information12
333       => p_rec.role_information12
334       ,p_role_information13
335       => p_rec.role_information13
336       ,p_role_information14
337       => p_rec.role_information14
338       ,p_role_information15
339       => p_rec.role_information15
340       ,p_role_information16
341       => p_rec.role_information16
342       ,p_role_information17
343       => p_rec.role_information17
344       ,p_role_information18
345       => p_rec.role_information18
346       ,p_role_information19
347       => p_rec.role_information19
348       ,p_role_information20
349       => p_rec.role_information20
350       ,p_object_version_number
351       => p_rec.object_version_number
352     ,p_job_id_o
353     => per_rol_shd.g_old_rec.job_id
354     ,p_job_group_id_o
355     => per_rol_shd.g_old_rec.job_group_id
356     ,p_person_id_o
357     => per_rol_shd.g_old_rec.person_id
358     ,p_organization_id_o
359     => per_rol_shd.g_old_rec.organization_id
360       ,p_start_date_o
361       => per_rol_shd.g_old_rec.start_date
362       ,p_end_date_o
363       => per_rol_shd.g_old_rec.end_date
364       ,p_confidential_date_o
365       => per_rol_shd.g_old_rec.confidential_date
366       ,p_emp_rights_flag_o
367       => per_rol_shd.g_old_rec.emp_rights_flag
368       ,p_end_of_rights_date_o
369       => per_rol_shd.g_old_rec.end_of_rights_date
370       ,p_primary_contact_flag_o
371       => per_rol_shd.g_old_rec.primary_contact_flag
372       ,p_attribute_category_o
373       => per_rol_shd.g_old_rec.attribute_category
374       ,p_attribute1_o
375       => per_rol_shd.g_old_rec.attribute1
376       ,p_attribute2_o
377       => per_rol_shd.g_old_rec.attribute2
378       ,p_attribute3_o
379       => per_rol_shd.g_old_rec.attribute3
380       ,p_attribute4_o
381       => per_rol_shd.g_old_rec.attribute4
382       ,p_attribute5_o
383       => per_rol_shd.g_old_rec.attribute5
384       ,p_attribute6_o
385       => per_rol_shd.g_old_rec.attribute6
386       ,p_attribute7_o
387       => per_rol_shd.g_old_rec.attribute7
388       ,p_attribute8_o
389       => per_rol_shd.g_old_rec.attribute8
390       ,p_attribute9_o
391       => per_rol_shd.g_old_rec.attribute9
392       ,p_attribute10_o
393       => per_rol_shd.g_old_rec.attribute10
394       ,p_attribute11_o
395       => per_rol_shd.g_old_rec.attribute11
396       ,p_attribute12_o
397       => per_rol_shd.g_old_rec.attribute12
398       ,p_attribute13_o
399       => per_rol_shd.g_old_rec.attribute13
400       ,p_attribute14_o
401       => per_rol_shd.g_old_rec.attribute14
402       ,p_attribute15_o
403       => per_rol_shd.g_old_rec.attribute15
404       ,p_attribute16_o
405       => per_rol_shd.g_old_rec.attribute16
406       ,p_attribute17_o
407       => per_rol_shd.g_old_rec.attribute17
408       ,p_attribute18_o
409       => per_rol_shd.g_old_rec.attribute18
410       ,p_attribute19_o
411       => per_rol_shd.g_old_rec.attribute19
412       ,p_attribute20_o
413       => per_rol_shd.g_old_rec.attribute20
414       ,p_role_information_category_o
415       => per_rol_shd.g_old_rec.role_information_category
416       ,p_role_information1_o
417       => per_rol_shd.g_old_rec.role_information1
418       ,p_role_information2_o
419       => per_rol_shd.g_old_rec.role_information2
420       ,p_role_information3_o
421       => per_rol_shd.g_old_rec.role_information3
422       ,p_role_information4_o
423       => per_rol_shd.g_old_rec.role_information4
424       ,p_role_information5_o
425       => per_rol_shd.g_old_rec.role_information5
426       ,p_role_information6_o
427       => per_rol_shd.g_old_rec.role_information6
428       ,p_role_information7_o
429       => per_rol_shd.g_old_rec.role_information7
430       ,p_role_information8_o
431       => per_rol_shd.g_old_rec.role_information8
432       ,p_role_information9_o
433       => per_rol_shd.g_old_rec.role_information9
434       ,p_role_information10_o
435       => per_rol_shd.g_old_rec.role_information10
436       ,p_role_information11_o
437       => per_rol_shd.g_old_rec.role_information11
438       ,p_role_information12_o
439       => per_rol_shd.g_old_rec.role_information12
440       ,p_role_information13_o
441       => per_rol_shd.g_old_rec.role_information13
442       ,p_role_information14_o
443       => per_rol_shd.g_old_rec.role_information14
444       ,p_role_information15_o
445       => per_rol_shd.g_old_rec.role_information15
446       ,p_role_information16_o
447       => per_rol_shd.g_old_rec.role_information16
448       ,p_role_information17_o
449       => per_rol_shd.g_old_rec.role_information17
450       ,p_role_information18_o
451       => per_rol_shd.g_old_rec.role_information18
452       ,p_role_information19_o
453       => per_rol_shd.g_old_rec.role_information19
454       ,p_role_information20_o
455       => per_rol_shd.g_old_rec.role_information20
456       ,p_object_version_number_o
457       => per_rol_shd.g_old_rec.object_version_number
458       );
459     --
460   exception
461     --
462     when hr_api.cannot_find_prog_unit then
463       --
464       hr_api.cannot_find_prog_unit_error
465         (p_module_name => 'PER_ROLES'
466         ,p_hook_type   => 'AU');
467       --
468   end;
469   --
470   hr_utility.set_location(' Leaving:'||l_proc, 10);
471 End post_update;
472 --
473 -- ----------------------------------------------------------------------------
474 -- |-----------------------------< convert_defs >-----------------------------|
475 -- ----------------------------------------------------------------------------
476 -- {Start Of Comments}
477 --
478 -- Description:
479 --   The Convert_Defs procedure has one very important function:
480 --   It must return the record structure for the row with all system defaulted
481 --   values converted into its corresponding parameter value for update. When
482 --   we attempt to update a row through the Upd process , certain
483 --   parameters can be defaulted which enables flexibility in the calling of
484 --   the upd process (e.g. only attributes which need to be updated need to be
485 --   specified). For the upd process to determine which attributes
486 --   have NOT been specified we need to check if the parameter has a reserved
487 --   system default value. Therefore, for all parameters which have a
488 --   corresponding reserved system default mechanism specified we need to
489 --   check if a system default is being used. If a system default is being
490 --   used then we convert the defaulted value into its corresponding attribute
491 --   value held in the g_old_rec data structure.
492 --
493 -- Prerequisites:
494 --   This private function can only be called from the upd process.
495 --
496 -- In Parameters:
497 --   A Pl/Sql record structure.
498 --
499 -- Post Success:
500 --   The record structure will be returned with all system defaulted parameter
501 --   values converted into its current row attribute value.
502 --
503 -- Post Failure:
504 --   No direct error handling is required within this function. Any possible
505 --   errors within this procedure will be a PL/SQL value error due to
506 --   conversion of datatypes or data lengths.
507 --
508 -- Developer Implementation Notes:
509 --   None.
510 --
511 -- Access Status:
512 --   Internal Row Handler Use Only.
513 --
514 -- {End Of Comments}
515 -- ----------------------------------------------------------------------------
516 Procedure convert_defs
517   (p_rec in out nocopy per_rol_shd.g_rec_type
518   ) is
519 --
520 Begin
521   --
522   -- We must now examine each argument value in the
523   -- p_rec plsql record structure
524   -- to see if a system default is being used. If a system default
525   -- is being used then we must set to the 'current' argument value.
526   --
527   If (p_rec.job_id = hr_api.g_number) then
528     p_rec.job_id :=
529     per_rol_shd.g_old_rec.job_id;
530   End If;
531   If (p_rec.job_group_id = hr_api.g_number) then
532     p_rec.job_group_id :=
533     per_rol_shd.g_old_rec.job_group_id;
534   End If;
535   If (p_rec.person_id = hr_api.g_number) then
536     p_rec.person_id :=
537     per_rol_shd.g_old_rec.person_id;
538   End If;
539   If (p_rec.organization_id = hr_api.g_number) then
540     p_rec.organization_id :=
541     per_rol_shd.g_old_rec.organization_id;
542   End If;
543   If (p_rec.start_date = hr_api.g_date) then
544     p_rec.start_date :=
545     per_rol_shd.g_old_rec.start_date;
546   End If;
547   If (p_rec.end_date = hr_api.g_date) then
548     p_rec.end_date :=
549     per_rol_shd.g_old_rec.end_date;
550   End If;
551   If (p_rec.confidential_date = hr_api.g_date) then
552     p_rec.confidential_date :=
553     per_rol_shd.g_old_rec.confidential_date;
554   End If;
555   If (p_rec.emp_rights_flag = hr_api.g_varchar2) then
556     p_rec.emp_rights_flag :=
557     per_rol_shd.g_old_rec.emp_rights_flag;
558   End If;
559   If (p_rec.end_of_rights_date = hr_api.g_date) then
560     p_rec.end_of_rights_date :=
561     per_rol_shd.g_old_rec.end_of_rights_date;
562   End If;
563   If (p_rec.primary_contact_flag = hr_api.g_varchar2) then
564     p_rec.primary_contact_flag :=
565     per_rol_shd.g_old_rec.primary_contact_flag;
566   End If;
567   If (p_rec.attribute_category = hr_api.g_varchar2) then
568     p_rec.attribute_category :=
569     per_rol_shd.g_old_rec.attribute_category;
570   End If;
571   If (p_rec.attribute1 = hr_api.g_varchar2) then
572     p_rec.attribute1 :=
573     per_rol_shd.g_old_rec.attribute1;
574   End If;
575   If (p_rec.attribute2 = hr_api.g_varchar2) then
576     p_rec.attribute2 :=
577     per_rol_shd.g_old_rec.attribute2;
578   End If;
579   If (p_rec.attribute3 = hr_api.g_varchar2) then
580     p_rec.attribute3 :=
581     per_rol_shd.g_old_rec.attribute3;
582   End If;
583   If (p_rec.attribute4 = hr_api.g_varchar2) then
584     p_rec.attribute4 :=
585     per_rol_shd.g_old_rec.attribute4;
586   End If;
587   If (p_rec.attribute5 = hr_api.g_varchar2) then
588     p_rec.attribute5 :=
589     per_rol_shd.g_old_rec.attribute5;
590   End If;
591   If (p_rec.attribute6 = hr_api.g_varchar2) then
592     p_rec.attribute6 :=
593     per_rol_shd.g_old_rec.attribute6;
594   End If;
595   If (p_rec.attribute7 = hr_api.g_varchar2) then
596     p_rec.attribute7 :=
597     per_rol_shd.g_old_rec.attribute7;
598   End If;
599   If (p_rec.attribute8 = hr_api.g_varchar2) then
600     p_rec.attribute8 :=
601     per_rol_shd.g_old_rec.attribute8;
602   End If;
603   If (p_rec.attribute9 = hr_api.g_varchar2) then
604     p_rec.attribute9 :=
605     per_rol_shd.g_old_rec.attribute9;
606   End If;
607   If (p_rec.attribute10 = hr_api.g_varchar2) then
608     p_rec.attribute10 :=
609     per_rol_shd.g_old_rec.attribute10;
610   End If;
611   If (p_rec.attribute11 = hr_api.g_varchar2) then
612     p_rec.attribute11 :=
613     per_rol_shd.g_old_rec.attribute11;
614   End If;
615   If (p_rec.attribute12 = hr_api.g_varchar2) then
616     p_rec.attribute12 :=
617     per_rol_shd.g_old_rec.attribute12;
618   End If;
619   If (p_rec.attribute13 = hr_api.g_varchar2) then
620     p_rec.attribute13 :=
621     per_rol_shd.g_old_rec.attribute13;
622   End If;
623   If (p_rec.attribute14 = hr_api.g_varchar2) then
624     p_rec.attribute14 :=
625     per_rol_shd.g_old_rec.attribute14;
626   End If;
627   If (p_rec.attribute15 = hr_api.g_varchar2) then
628     p_rec.attribute15 :=
629     per_rol_shd.g_old_rec.attribute15;
630   End If;
631   If (p_rec.attribute16 = hr_api.g_varchar2) then
632     p_rec.attribute16 :=
633     per_rol_shd.g_old_rec.attribute16;
634   End If;
635   If (p_rec.attribute17 = hr_api.g_varchar2) then
636     p_rec.attribute17 :=
637     per_rol_shd.g_old_rec.attribute17;
638   End If;
639   If (p_rec.attribute18 = hr_api.g_varchar2) then
640     p_rec.attribute18 :=
641     per_rol_shd.g_old_rec.attribute18;
642   End If;
643   If (p_rec.attribute19 = hr_api.g_varchar2) then
644     p_rec.attribute19 :=
645     per_rol_shd.g_old_rec.attribute19;
646   End If;
647   If (p_rec.attribute20 = hr_api.g_varchar2) then
648     p_rec.attribute20 :=
649     per_rol_shd.g_old_rec.attribute20;
650   End If;
651   If (p_rec.role_information_category = hr_api.g_varchar2) then
652     p_rec.role_information_category :=
653     per_rol_shd.g_old_rec.role_information_category;
654   End If;
655   If (p_rec.role_information1 = hr_api.g_varchar2) then
656     p_rec.role_information1 :=
657     per_rol_shd.g_old_rec.role_information1;
658   End If;
659   If (p_rec.role_information2 = hr_api.g_varchar2) then
660     p_rec.role_information2 :=
661     per_rol_shd.g_old_rec.role_information2;
662   End If;
663   If (p_rec.role_information3 = hr_api.g_varchar2) then
664     p_rec.role_information3 :=
665     per_rol_shd.g_old_rec.role_information3;
666   End If;
667   If (p_rec.role_information4 = hr_api.g_varchar2) then
668     p_rec.role_information4 :=
669     per_rol_shd.g_old_rec.role_information4;
670   End If;
671   If (p_rec.role_information5 = hr_api.g_varchar2) then
672     p_rec.role_information5 :=
673     per_rol_shd.g_old_rec.role_information5;
674   End If;
675   If (p_rec.role_information6 = hr_api.g_varchar2) then
676     p_rec.role_information6 :=
677     per_rol_shd.g_old_rec.role_information6;
678   End If;
679   If (p_rec.role_information7 = hr_api.g_varchar2) then
680     p_rec.role_information7 :=
681     per_rol_shd.g_old_rec.role_information7;
682   End If;
683   If (p_rec.role_information8 = hr_api.g_varchar2) then
684     p_rec.role_information8 :=
685     per_rol_shd.g_old_rec.role_information8;
686   End If;
687   If (p_rec.role_information9 = hr_api.g_varchar2) then
688     p_rec.role_information9 :=
689     per_rol_shd.g_old_rec.role_information9;
690   End If;
691   If (p_rec.role_information10 = hr_api.g_varchar2) then
692     p_rec.role_information10 :=
693     per_rol_shd.g_old_rec.role_information10;
694   End If;
695   If (p_rec.role_information11 = hr_api.g_varchar2) then
696     p_rec.role_information11 :=
697     per_rol_shd.g_old_rec.role_information11;
698   End If;
699   If (p_rec.role_information12 = hr_api.g_varchar2) then
700     p_rec.role_information12 :=
701     per_rol_shd.g_old_rec.role_information12;
702   End If;
703   If (p_rec.role_information13 = hr_api.g_varchar2) then
704     p_rec.role_information13 :=
705     per_rol_shd.g_old_rec.role_information13;
706   End If;
707   If (p_rec.role_information14 = hr_api.g_varchar2) then
708     p_rec.role_information14 :=
709     per_rol_shd.g_old_rec.role_information14;
710   End If;
711   If (p_rec.role_information15 = hr_api.g_varchar2) then
712     p_rec.role_information15 :=
713     per_rol_shd.g_old_rec.role_information15;
714   End If;
715   If (p_rec.role_information16 = hr_api.g_varchar2) then
716     p_rec.role_information16 :=
717     per_rol_shd.g_old_rec.role_information16;
718   End If;
719   If (p_rec.role_information17 = hr_api.g_varchar2) then
720     p_rec.role_information17 :=
721     per_rol_shd.g_old_rec.role_information17;
722   End If;
723   If (p_rec.role_information18 = hr_api.g_varchar2) then
724     p_rec.role_information18 :=
725     per_rol_shd.g_old_rec.role_information18;
726   End If;
727   If (p_rec.role_information19 = hr_api.g_varchar2) then
728     p_rec.role_information19 :=
729     per_rol_shd.g_old_rec.role_information19;
730   End If;
731   If (p_rec.role_information20 = hr_api.g_varchar2) then
732     p_rec.role_information20 :=
733     per_rol_shd.g_old_rec.role_information20;
734   End If;
735   --
736 End convert_defs;
737 --
738 -- ----------------------------------------------------------------------------
739 -- |---------------------------------< upd >----------------------------------|
740 -- ----------------------------------------------------------------------------
741 Procedure upd
742   (p_effective_date               in date
743   ,p_rec                          in out nocopy per_rol_shd.g_rec_type
744   ) is
745 --
746   l_proc  varchar2(72) := g_package||'upd';
747 --
748 Begin
749   hr_utility.set_location('Entering:'||l_proc, 5);
750   --
751   -- We must lock the row which we need to update.
752   --
753   per_rol_shd.lck
754     (p_rec.role_id
755     ,p_rec.object_version_number
756     );
757   --
758   -- 1. During an update system defaults are used to determine if
759   --    arguments have been defaulted or not. We must therefore
760   --    derive the full record structure values to be updated.
761   --
762   -- 2. Call the supporting update validate operations.
763   --
764   convert_defs(p_rec);
765   per_rol_bus.update_validate
766      (p_effective_date
767      ,p_rec
768      );
769   --
770   -- Call the supporting pre-update operation
771   --
772   per_rol_upd.pre_update(p_rec);
773   --
774   -- Update the row.
775   --
776   per_rol_upd.update_dml(p_rec);
777   --
778   -- Call the supporting post-update operation
779   --
780   per_rol_upd.post_update
781      (p_effective_date
782      ,p_rec
783      );
784 End upd;
785 --
786 -- ----------------------------------------------------------------------------
787 -- |---------------------------------< upd >----------------------------------|
788 -- ----------------------------------------------------------------------------
789 Procedure upd
790   (p_effective_date               in     date
791   ,p_role_id                      in     number
792   ,p_object_version_number        in out nocopy number
793   ,p_start_date                   in     date      default hr_api.g_date
794   ,p_end_date                     in     date      default hr_api.g_date
795   ,p_confidential_date            in     date      default hr_api.g_date
796   ,p_emp_rights_flag              in     varchar2  default hr_api.g_varchar2
797   ,p_end_of_rights_date           in     date      default hr_api.g_date
798   ,p_primary_contact_flag         in     varchar2  default hr_api.g_varchar2
799   ,p_attribute_category           in     varchar2  default hr_api.g_varchar2
800   ,p_attribute1                   in     varchar2  default hr_api.g_varchar2
801   ,p_attribute2                   in     varchar2  default hr_api.g_varchar2
802   ,p_attribute3                   in     varchar2  default hr_api.g_varchar2
803   ,p_attribute4                   in     varchar2  default hr_api.g_varchar2
804   ,p_attribute5                   in     varchar2  default hr_api.g_varchar2
805   ,p_attribute6                   in     varchar2  default hr_api.g_varchar2
806   ,p_attribute7                   in     varchar2  default hr_api.g_varchar2
807   ,p_attribute8                   in     varchar2  default hr_api.g_varchar2
808   ,p_attribute9                   in     varchar2  default hr_api.g_varchar2
809   ,p_attribute10                  in     varchar2  default hr_api.g_varchar2
810   ,p_attribute11                  in     varchar2  default hr_api.g_varchar2
811   ,p_attribute12                  in     varchar2  default hr_api.g_varchar2
812   ,p_attribute13                  in     varchar2  default hr_api.g_varchar2
813   ,p_attribute14                  in     varchar2  default hr_api.g_varchar2
814   ,p_attribute15                  in     varchar2  default hr_api.g_varchar2
815   ,p_attribute16                  in     varchar2  default hr_api.g_varchar2
816   ,p_attribute17                  in     varchar2  default hr_api.g_varchar2
817   ,p_attribute18                  in     varchar2  default hr_api.g_varchar2
818   ,p_attribute19                  in     varchar2  default hr_api.g_varchar2
819   ,p_attribute20                  in     varchar2  default hr_api.g_varchar2
820   ,p_role_information_category    in     varchar2  default hr_api.g_varchar2
821   ,p_role_information1            in     varchar2  default hr_api.g_varchar2
822   ,p_role_information2            in     varchar2  default hr_api.g_varchar2
823   ,p_role_information3            in     varchar2  default hr_api.g_varchar2
824   ,p_role_information4            in     varchar2  default hr_api.g_varchar2
825   ,p_role_information5            in     varchar2  default hr_api.g_varchar2
826   ,p_role_information6            in     varchar2  default hr_api.g_varchar2
827   ,p_role_information7            in     varchar2  default hr_api.g_varchar2
828   ,p_role_information8            in     varchar2  default hr_api.g_varchar2
829   ,p_role_information9            in     varchar2  default hr_api.g_varchar2
830   ,p_role_information10           in     varchar2  default hr_api.g_varchar2
831   ,p_role_information11           in     varchar2  default hr_api.g_varchar2
832   ,p_role_information12           in     varchar2  default hr_api.g_varchar2
833   ,p_role_information13           in     varchar2  default hr_api.g_varchar2
834   ,p_role_information14           in     varchar2  default hr_api.g_varchar2
835   ,p_role_information15           in     varchar2  default hr_api.g_varchar2
836   ,p_role_information16           in     varchar2  default hr_api.g_varchar2
837   ,p_role_information17           in     varchar2  default hr_api.g_varchar2
838   ,p_role_information18           in     varchar2  default hr_api.g_varchar2
839   ,p_role_information19           in     varchar2  default hr_api.g_varchar2
840   ,p_role_information20           in     varchar2  default hr_api.g_varchar2
841   ,p_old_end_date                 in     date      default hr_api.g_date     -- fix 1370960
842   ) is
843 --
844   l_rec    per_rol_shd.g_rec_type;
845   l_proc  varchar2(72) := g_package||'upd';
846 --
847 Begin
848   hr_utility.set_location('Entering:'||l_proc, 5);
849   --
850   -- Call conversion function to turn arguments into the
851   -- l_rec structure.
852   --
853   l_rec :=
854   per_rol_shd.convert_args
855   (p_role_id
856   ,hr_api.g_number
857   ,hr_api.g_number
858   ,hr_api.g_number
859   ,hr_api.g_number
860   ,p_start_date
861   ,p_end_date
862   ,p_confidential_date
863   ,p_emp_rights_flag
864   ,p_end_of_rights_date
865   ,p_primary_contact_flag
866   ,p_attribute_category
867   ,p_attribute1
868   ,p_attribute2
869   ,p_attribute3
870   ,p_attribute4
871   ,p_attribute5
872   ,p_attribute6
873   ,p_attribute7
874   ,p_attribute8
875   ,p_attribute9
876   ,p_attribute10
877   ,p_attribute11
878   ,p_attribute12
879   ,p_attribute13
880   ,p_attribute14
881   ,p_attribute15
882   ,p_attribute16
883   ,p_attribute17
884   ,p_attribute18
885   ,p_attribute19
886   ,p_attribute20
887   ,p_role_information_category
888   ,p_role_information1
889   ,p_role_information2
890   ,p_role_information3
891   ,p_role_information4
892   ,p_role_information5
893   ,p_role_information6
894   ,p_role_information7
895   ,p_role_information8
896   ,p_role_information9
897   ,p_role_information10
898   ,p_role_information11
899   ,p_role_information12
900   ,p_role_information13
901   ,p_role_information14
902   ,p_role_information15
903   ,p_role_information16
904   ,p_role_information17
905   ,p_role_information18
906   ,p_role_information19
907   ,p_role_information20
908   ,p_object_version_number
909   ,p_old_end_date -- fix 1370960
910   );
911   --
912   -- Having converted the arguments into the
913   -- plsql record structure we call the corresponding record
914   -- business process.
915   --
916   per_rol_upd.upd
917      (p_effective_date
918      ,l_rec
919      );
920   p_object_version_number := l_rec.object_version_number;
921   --
922   hr_utility.set_location(' Leaving:'||l_proc, 10);
923 End upd;
924 --
925 end per_rol_upd;