DBA Data[Home] [Help]
Skip to content

PACKAGE BODY: APPS.PER_SIP_UPD

Source


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