DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PMA_UPD

Source


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