DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PMS_UPD

Source


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