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