DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PEA_UPD

Source


1 Package Body per_pea_upd as
2 /* $Header: pepearhi.pkb 120.0.12010000.1 2008/07/28 05:10:27 appldev ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_pea_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 -- Pre Conditions:
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 Table Handler Use Only.
51 --
52 -- {End Of Comments}
53 -- ----------------------------------------------------------------------------
54 Procedure update_dml(p_rec in out nocopy per_pea_shd.g_rec_type) is
55 --
56   l_proc  varchar2(72) := g_package||'update_dml';
57 --
58 Begin
59   hr_utility.set_location('Entering:'||l_proc, 5);
60   --
61   -- Increment the object version
62   --
63   p_rec.object_version_number := p_rec.object_version_number + 1;
64   --
65   per_pea_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the per_person_analyses Row
68   --
69   update per_person_analyses
70   set
71   analysis_criteria_id              = p_rec.analysis_criteria_id,
72   comments                          = p_rec.comments,
73   date_from                         = p_rec.date_from,
74   date_to                           = p_rec.date_to,
75   id_flex_num                       = p_rec.id_flex_num,
76   request_id                        = p_rec.request_id,
77   program_application_id            = p_rec.program_application_id,
78   program_id                        = p_rec.program_id,
79   program_update_date               = p_rec.program_update_date,
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   object_version_number             = p_rec.object_version_number
102   where person_analysis_id = p_rec.person_analysis_id;
103   --
104   per_pea_shd.g_api_dml := false;   -- Unset the api dml status
105   --
106   hr_utility.set_location(' Leaving:'||l_proc, 10);
107 --
108 Exception
109   When hr_api.check_integrity_violated Then
110     -- A check constraint has been violated
111     per_pea_shd.g_api_dml := false;   -- Unset the api dml status
112     per_pea_shd.constraint_error
113       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
114   When hr_api.parent_integrity_violated Then
115     -- Parent integrity has been violated
116     per_pea_shd.g_api_dml := false;   -- Unset the api dml status
117     per_pea_shd.constraint_error
118       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
119   When hr_api.unique_integrity_violated Then
120     -- Unique integrity has been violated
121     per_pea_shd.g_api_dml := false;   -- Unset the api dml status
122     per_pea_shd.constraint_error
123       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
124   When Others Then
125     per_pea_shd.g_api_dml := false;   -- Unset the api dml status
126     Raise;
127 End update_dml;
128 --
129 -- ----------------------------------------------------------------------------
130 -- |------------------------------< pre_update >------------------------------|
131 -- ----------------------------------------------------------------------------
132 -- {Start Of Comments}
133 --
134 -- Description:
135 --   This private procedure contains any processing which is required before
136 --   the update dml.
137 --
138 -- Pre Conditions:
139 --   This is an internal procedure which is called from the upd procedure.
140 --
141 -- In Parameters:
142 --   A Pl/Sql record structre.
143 --
144 -- Post Success:
145 --   Processing continues.
146 --
147 -- Post Failure:
148 --   If an error has occurred, an error message and exception will be raised
149 --   but not handled.
150 --
151 -- Developer Implementation Notes:
152 --   Any pre-processing required before the update dml is issued should be
153 --   coded within this procedure. It is important to note that any 3rd party
154 --   maintenance should be reviewed before placing in this procedure.
155 --
156 -- Access Status:
157 --   Internal Table Handler Use Only.
158 --
159 -- {End Of Comments}
160 -- ----------------------------------------------------------------------------
161 Procedure pre_update(p_rec in per_pea_shd.g_rec_type) is
162 --
163   l_proc  varchar2(72) := g_package||'pre_update';
164 --
165 Begin
166   hr_utility.set_location('Entering:'||l_proc, 5);
167   --
168   hr_utility.set_location(' Leaving:'||l_proc, 10);
169 End pre_update;
170 --
171 -- ----------------------------------------------------------------------------
172 -- |-----------------------------< post_update >------------------------------|
173 -- ----------------------------------------------------------------------------
174 -- {Start Of Comments}
175 --
176 -- Description:
177 --   This private procedure contains any processing which is required after the
178 --   update dml.
179 --
180 -- Pre Conditions:
181 --   This is an internal procedure which is called from the upd procedure.
182 --
183 -- In Parameters:
184 --   A Pl/Sql record structre.
185 --
186 -- Post Success:
187 --   Processing continues.
188 --
189 -- Post Failure:
190 --   If an error has occurred, an error message and exception will be raised
191 --   but not handled.
192 --
193 -- Developer Implementation Notes:
194 --   Any post-processing required after the update dml is issued should be
195 --   coded within this procedure. It is important to note that any 3rd party
196 --   maintenance should be reviewed before placing in this procedure.
197 --
198 -- Access Status:
199 --   Internal Table Handler Use Only.
200 --
201 -- {End Of Comments}
202 -- ----------------------------------------------------------------------------
203 Procedure post_update
204      (p_rec             in per_pea_shd.g_rec_type) is
205 --
206   l_proc  varchar2(72) := g_package||'post_update';
207 
208   -- For BEN LER Check
209     l_old_rec               ben_pac_ler.g_pac_ler_rec;
210     l_new_rec               ben_pac_ler.g_pac_ler_rec;
211 
212 
213 Begin
214   hr_utility.set_location('Entering:'||l_proc, 5);
215   --
216   -- Start of API User Hook for post_update.
217   begin
218     per_pea_rku.after_update
219       (
220         p_person_analysis_id            => p_rec.person_analysis_id,
221         p_analysis_criteria_id          => p_rec.analysis_criteria_id,
222         p_comments                      => p_rec.comments,
223         p_date_from                     => p_rec.date_from,
224         p_date_to                       => p_rec.date_to,
225         p_id_flex_num                   => p_rec.id_flex_num,
226         p_request_id                    => p_rec.request_id,
227         p_program_application_id        => p_rec.program_application_id,
228         p_program_id                    => p_rec.program_id,
229         p_program_update_date           => p_rec.program_update_date,
230         p_attribute_category            => p_rec.attribute_category,
231         p_attribute1                    => p_rec.attribute1,
232         p_attribute2                    => p_rec.attribute2,
233         p_attribute3                    => p_rec.attribute3,
234         p_attribute4                    => p_rec.attribute4,
235         p_attribute5                    => p_rec.attribute5,
236         p_attribute6                    => p_rec.attribute6,
237         p_attribute7                    => p_rec.attribute7,
238         p_attribute8                    => p_rec.attribute8,
239         p_attribute9                    => p_rec.attribute9,
240         p_attribute10                   => p_rec.attribute10,
241         p_attribute11                   => p_rec.attribute11,
242         p_attribute12                   => p_rec.attribute12,
243         p_attribute13                   => p_rec.attribute13,
244         p_attribute14                   => p_rec.attribute14,
245         p_attribute15                   => p_rec.attribute15,
246         p_attribute16                   => p_rec.attribute16,
247         p_attribute17                   => p_rec.attribute17,
248         p_attribute18                   => p_rec.attribute18,
249         p_attribute19                   => p_rec.attribute19,
250         p_attribute20                   => p_rec.attribute20,
251         p_object_version_number         => p_rec.object_version_number,
252         p_business_group_id_o           => per_pea_shd.g_old_rec.business_group_id,
253         p_analysis_criteria_id_o        => per_pea_shd.g_old_rec.analysis_criteria_id,
254         p_person_id_o                   => per_pea_shd.g_old_rec.person_id,
255         p_comments_o                    => per_pea_shd.g_old_rec.comments,
256         p_date_from_o                   => per_pea_shd.g_old_rec.date_from,
257         p_date_to_o                     => per_pea_shd.g_old_rec.date_to,
258         p_id_flex_num_o                 => per_pea_shd.g_old_rec.id_flex_num,
259         p_request_id_o                  => per_pea_shd.g_old_rec.request_id,
260         p_program_application_id_o      => per_pea_shd.g_old_rec.program_application_id,
261         p_program_id_o                  => per_pea_shd.g_old_rec.program_id,
262         p_program_update_date_o         => per_pea_shd.g_old_rec.program_update_date,
263         p_attribute_category_o          => per_pea_shd.g_old_rec.attribute_category,
264         p_attribute1_o                  => per_pea_shd.g_old_rec.attribute1,
265         p_attribute2_o                  => per_pea_shd.g_old_rec.attribute2,
266         p_attribute3_o                  => per_pea_shd.g_old_rec.attribute3,
267         p_attribute4_o                  => per_pea_shd.g_old_rec.attribute4,
268         p_attribute5_o                  => per_pea_shd.g_old_rec.attribute5,
269         p_attribute6_o                  => per_pea_shd.g_old_rec.attribute6,
270         p_attribute7_o                  => per_pea_shd.g_old_rec.attribute7,
271         p_attribute8_o                  => per_pea_shd.g_old_rec.attribute8,
272         p_attribute9_o                  => per_pea_shd.g_old_rec.attribute9,
273         p_attribute10_o                 => per_pea_shd.g_old_rec.attribute10,
274         p_attribute11_o                 => per_pea_shd.g_old_rec.attribute11,
275         p_attribute12_o                 => per_pea_shd.g_old_rec.attribute12,
276         p_attribute13_o                 => per_pea_shd.g_old_rec.attribute13,
277         p_attribute14_o                 => per_pea_shd.g_old_rec.attribute14,
278         p_attribute15_o                 => per_pea_shd.g_old_rec.attribute15,
279         p_attribute16_o                 => per_pea_shd.g_old_rec.attribute16,
280         p_attribute17_o                 => per_pea_shd.g_old_rec.attribute17,
281         p_attribute18_o                 => per_pea_shd.g_old_rec.attribute18,
282         p_attribute19_o                 => per_pea_shd.g_old_rec.attribute19,
283         p_attribute20_o                 => per_pea_shd.g_old_rec.attribute20,
284         p_object_version_number_o       => per_pea_shd.g_old_rec.object_version_number
285        );
286 
287 -- Start of BEN LER Check
288    l_old_rec.person_id  := per_pea_shd.g_old_rec.person_id;
289    l_old_rec.business_group_id := per_pea_shd.g_old_rec.business_group_id;
290    l_old_rec.ANALYSIS_CRITERIA_ID  := per_pea_shd.g_old_rec.ANALYSIS_CRITERIA_ID;
291    l_old_rec.DATE_FROM             := per_pea_shd.g_old_rec.DATE_FROM;
292    l_old_rec.DATE_TO               := per_pea_shd.g_old_rec.DATE_TO;
293    l_old_rec.ID_FLEX_NUM           := per_pea_shd.g_old_rec.ID_FLEX_NUM;
294    l_old_rec.attribute1 :=per_pea_shd.g_old_rec.attribute1;
295    l_old_rec.attribute2 :=per_pea_shd.g_old_rec.attribute2;
296    l_old_rec.attribute3 :=per_pea_shd.g_old_rec.attribute3;
297    l_old_rec.attribute4 :=per_pea_shd.g_old_rec.attribute4;
298    l_old_rec.attribute5 :=per_pea_shd.g_old_rec.attribute5;
299    l_old_rec.attribute6 :=per_pea_shd.g_old_rec.attribute6;
300    l_old_rec.attribute7 :=per_pea_shd.g_old_rec.attribute7;
301    l_old_rec.attribute8 :=per_pea_shd.g_old_rec.attribute8;
302    l_old_rec.attribute9 :=per_pea_shd.g_old_rec.attribute9;
303    l_old_rec.attribute10 :=per_pea_shd.g_old_rec.attribute10;
304    l_old_rec.attribute11 :=per_pea_shd.g_old_rec.attribute11;
305    l_old_rec.attribute12 :=per_pea_shd.g_old_rec.attribute12;
306    l_old_rec.attribute13 :=per_pea_shd.g_old_rec.attribute13;
307    l_old_rec.attribute14 :=per_pea_shd.g_old_rec.attribute14;
308    l_old_rec.attribute15 :=per_pea_shd.g_old_rec.attribute15;
309    l_old_rec.attribute16 :=per_pea_shd.g_old_rec.attribute16;
310    l_old_rec.attribute17 :=per_pea_shd.g_old_rec.attribute17;
311    l_old_rec.attribute18 :=per_pea_shd.g_old_rec.attribute18;
312    l_old_rec.attribute19 :=per_pea_shd.g_old_rec.attribute19;
313    l_old_rec.attribute20 :=per_pea_shd.g_old_rec.attribute20;
314 
315   l_new_rec.person_id  := p_rec.person_id;
316   l_new_rec.business_group_id := p_rec.business_group_id;
317   l_new_rec.ANALYSIS_CRITERIA_ID  := p_rec.ANALYSIS_CRITERIA_ID;
318   l_new_rec.DATE_FROM             := p_rec.DATE_FROM;
319   l_new_rec.DATE_TO               := p_rec.DATE_TO;
320   l_new_rec.ID_FLEX_NUM           := p_rec.ID_FLEX_NUM;
321   l_new_rec.attribute1 :=p_rec.attribute1;
322   l_new_rec.attribute2 :=p_rec.attribute2;
323   l_new_rec.attribute3 :=p_rec.attribute3;
324   l_new_rec.attribute4 :=p_rec.attribute4;
325   l_new_rec.attribute5 :=p_rec.attribute5;
326   l_new_rec.attribute6 :=p_rec.attribute6;
327   l_new_rec.attribute7 :=p_rec.attribute7;
328   l_new_rec.attribute8 :=p_rec.attribute8;
329   l_new_rec.attribute9 :=p_rec.attribute9;
330   l_new_rec.attribute10 :=p_rec.attribute10;
331   l_new_rec.attribute11 :=p_rec.attribute11;
332   l_new_rec.attribute12 :=p_rec.attribute12;
333   l_new_rec.attribute13 :=p_rec.attribute13;
334   l_new_rec.attribute14 :=p_rec.attribute14;
335   l_new_rec.attribute15 :=p_rec.attribute15;
336   l_new_rec.attribute16 :=p_rec.attribute16;
337   l_new_rec.attribute17 :=p_rec.attribute17;
338   l_new_rec.attribute18 :=p_rec.attribute18;
339   l_new_rec.attribute19 :=p_rec.attribute19;
340   l_new_rec.attribute20 :=p_rec.attribute20;
341 
342   hr_utility.set_location('Calling BEN Package :'||l_proc, 7);
343 
344   ben_pac_ler.ler_chk(l_old_rec
345                         ,l_new_rec
346                       ,nvl(l_new_rec.date_from, sysdate ));
347 
348   hr_utility.set_location('End of BEN Call :'||l_proc, 9);
349 
350 -- End of BEN LER Check
351 
352 
353   exception
354     when hr_api.cannot_find_prog_unit then
355       hr_api.cannot_find_prog_unit_error
356         (p_module_name => 'PER_PERSON_ANALYSES'
357         ,p_hook_type   => 'AU'
358         );
359   end;
360   -- End of API User Hook for post_update.
361   --
362    hr_utility.set_location(' Leaving:'||l_proc, 10);
363 End post_update;
364 --
365 -- ----------------------------------------------------------------------------
366 -- |-----------------------------< convert_defs >-----------------------------|
367 -- ----------------------------------------------------------------------------
368 -- {Start Of Comments}
369 --
370 -- Description:
371 --   The Convert_Defs procedure has one very important function:
372 --   It must return the record structure for the row with all system defaulted
373 --   values converted into its corresponding parameter value for update. When
374 --   we attempt to update a row through the Upd process , certain
375 --   parameters can be defaulted which enables flexibility in the calling of
376 --   the upd process (e.g. only attributes which need to be updated need to be
377 --   specified). For the upd process to determine which attributes
378 --   have NOT been specified we need to check if the parameter has a reserved
379 --   system default value. Therefore, for all parameters which have a
380 --   corresponding reserved system default mechanism specified we need to
381 --   check if a system default is being used. If a system default is being
382 --   used then we convert the defaulted value into its corresponding attribute
383 --   value held in the g_old_rec data structure.
384 --
385 -- Pre Conditions:
386 --   This private function can only be called from the upd process.
387 --
388 -- In Parameters:
389 --   A Pl/Sql record structre.
390 --
391 -- Post Success:
392 --   The record structure will be returned with all system defaulted parameter
393 --   values converted into its current row attribute value.
394 --
395 -- Post Failure:
396 --   No direct error handling is required within this function. Any possible
397 --   errors within this procedure will be a PL/SQL value error due to conversion
398 
399 --   of datatypes or data lengths.
400 --
401 -- Developer Implementation Notes:
402 --   None.
403 --
404 -- Access Status:
405 --   Internal Table Handler Use Only.
406 --
407 -- {End Of Comments}
408 -- ----------------------------------------------------------------------------
409 Procedure convert_defs(p_rec in out nocopy per_pea_shd.g_rec_type) is
410 --
411   l_proc  varchar2(72) := g_package||'convert_defs';
412 --
413 Begin
414   --
415   hr_utility.set_location('Entering:'||l_proc, 5);
416   --
417   -- We must now examine each argument value in the
418   -- p_rec plsql record structure
419   -- to see if a system default is being used. If a system default
420   -- is being used then we must set to the 'current' argument value.
421   --
422   If (p_rec.business_group_id = hr_api.g_number) then
423     p_rec.business_group_id :=
424     per_pea_shd.g_old_rec.business_group_id;
425   End If;
426   If (p_rec.analysis_criteria_id = hr_api.g_number) then
427     p_rec.analysis_criteria_id :=
428     per_pea_shd.g_old_rec.analysis_criteria_id;
429   End If;
430   If (p_rec.person_id = hr_api.g_number) then
431     p_rec.person_id :=
432     per_pea_shd.g_old_rec.person_id;
433   End If;
434   If (p_rec.comments = hr_api.g_varchar2) then
435     p_rec.comments :=
436     per_pea_shd.g_old_rec.comments;
437   End If;
438   If (p_rec.date_from = hr_api.g_date) then
439     p_rec.date_from :=
440     per_pea_shd.g_old_rec.date_from;
441   End If;
442   If (p_rec.date_to = hr_api.g_date) then
443     p_rec.date_to :=
444     per_pea_shd.g_old_rec.date_to;
445   End If;
446   If (p_rec.id_flex_num = hr_api.g_number) then
447     p_rec.id_flex_num :=
448     per_pea_shd.g_old_rec.id_flex_num;
449   End If;
450   If (p_rec.request_id = hr_api.g_number) then
451     p_rec.request_id :=
452     per_pea_shd.g_old_rec.request_id;
453   End If;
454   If (p_rec.program_application_id = hr_api.g_number) then
455     p_rec.program_application_id :=
456     per_pea_shd.g_old_rec.program_application_id;
457   End If;
458   If (p_rec.program_id = hr_api.g_number) then
459     p_rec.program_id :=
460     per_pea_shd.g_old_rec.program_id;
461   End If;
462   If (p_rec.program_update_date = hr_api.g_date) then
463     p_rec.program_update_date :=
464     per_pea_shd.g_old_rec.program_update_date;
465   End If;
466   If (p_rec.attribute_category = hr_api.g_varchar2) then
467     p_rec.attribute_category :=
468     per_pea_shd.g_old_rec.attribute_category;
469   End If;
470   If (p_rec.attribute1 = hr_api.g_varchar2) then
471     p_rec.attribute1 :=
472     per_pea_shd.g_old_rec.attribute1;
473   End If;
474   If (p_rec.attribute2 = hr_api.g_varchar2) then
475     p_rec.attribute2 :=
476     per_pea_shd.g_old_rec.attribute2;
477   End If;
478   If (p_rec.attribute3 = hr_api.g_varchar2) then
479     p_rec.attribute3 :=
480     per_pea_shd.g_old_rec.attribute3;
481   End If;
482   If (p_rec.attribute4 = hr_api.g_varchar2) then
483     p_rec.attribute4 :=
484     per_pea_shd.g_old_rec.attribute4;
485   End If;
486   If (p_rec.attribute5 = hr_api.g_varchar2) then
487     p_rec.attribute5 :=
488     per_pea_shd.g_old_rec.attribute5;
489   End If;
490   If (p_rec.attribute6 = hr_api.g_varchar2) then
491     p_rec.attribute6 :=
492     per_pea_shd.g_old_rec.attribute6;
493   End If;
494   If (p_rec.attribute7 = hr_api.g_varchar2) then
495     p_rec.attribute7 :=
496     per_pea_shd.g_old_rec.attribute7;
497   End If;
498   If (p_rec.attribute8 = hr_api.g_varchar2) then
499     p_rec.attribute8 :=
500     per_pea_shd.g_old_rec.attribute8;
501   End If;
502   If (p_rec.attribute9 = hr_api.g_varchar2) then
503     p_rec.attribute9 :=
504     per_pea_shd.g_old_rec.attribute9;
505   End If;
506   If (p_rec.attribute10 = hr_api.g_varchar2) then
507     p_rec.attribute10 :=
508     per_pea_shd.g_old_rec.attribute10;
509   End If;
510   If (p_rec.attribute11 = hr_api.g_varchar2) then
511     p_rec.attribute11 :=
512     per_pea_shd.g_old_rec.attribute11;
513   End If;
514   If (p_rec.attribute12 = hr_api.g_varchar2) then
515     p_rec.attribute12 :=
516     per_pea_shd.g_old_rec.attribute12;
517   End If;
518   If (p_rec.attribute13 = hr_api.g_varchar2) then
519     p_rec.attribute13 :=
520     per_pea_shd.g_old_rec.attribute13;
521   End If;
522   If (p_rec.attribute14 = hr_api.g_varchar2) then
523     p_rec.attribute14 :=
524     per_pea_shd.g_old_rec.attribute14;
525   End If;
526   If (p_rec.attribute15 = hr_api.g_varchar2) then
527     p_rec.attribute15 :=
528     per_pea_shd.g_old_rec.attribute15;
529   End If;
530   If (p_rec.attribute16 = hr_api.g_varchar2) then
531     p_rec.attribute16 :=
532     per_pea_shd.g_old_rec.attribute16;
533   End If;
534   If (p_rec.attribute17 = hr_api.g_varchar2) then
535     p_rec.attribute17 :=
536     per_pea_shd.g_old_rec.attribute17;
537   End If;
538   If (p_rec.attribute18 = hr_api.g_varchar2) then
539     p_rec.attribute18 :=
540     per_pea_shd.g_old_rec.attribute18;
541   End If;
542   If (p_rec.attribute19 = hr_api.g_varchar2) then
543     p_rec.attribute19 :=
544     per_pea_shd.g_old_rec.attribute19;
545   End If;
546   If (p_rec.attribute20 = hr_api.g_varchar2) then
547     p_rec.attribute20 :=
548     per_pea_shd.g_old_rec.attribute20;
549   End If;
550   --
551   hr_utility.set_location(' Leaving:'||l_proc, 10);
552 --
553 End convert_defs;
554 --
555 -- ----------------------------------------------------------------------------
556 -- |---------------------------------< upd >----------------------------------|
557 -- ----------------------------------------------------------------------------
558 Procedure upd
559   (
560    p_rec        in out nocopy per_pea_shd.g_rec_type,
561    p_validate   in     boolean default false
562   ) is
563 --
564   l_proc      			varchar2(72) := g_package||'upd';
565   l_rec				per_pea_shd.g_rec_type;
566   l_object_version_number  	number;
567 
568 --
569 Begin
570   hr_utility.set_location('Entering:'||l_proc, 5);
571   --
572   -- Determine if the business process is to be validated.
573   --
574   l_rec := p_rec;
575   If p_validate then
576     --
577     -- Issue the savepoint.
578     --
579     l_object_version_number := p_rec.object_version_number;
580     SAVEPOINT upd_per_pea;
581   End If;
582   --
583   -- We must lock the row which we need to update.
584   --
585   per_pea_shd.lck
586 	(
587          p_rec.person_analysis_id,
588          p_rec.object_version_number
589 	);
590   --
591   -- 1. During an update system defaults are used to determine if
592   --    arguments have been defaulted or not. We must therefore
593   --    derive the full record structure values to be updated.
594   --
595   -- 2. Call the supporting update validate operations.
596   --
597   convert_defs(p_rec);
598   per_pea_bus.update_validate(p_rec	=> p_rec);
599   --
600   -- Call to raise any errors on multi-message list
601   --
602   hr_multi_message.end_validation_set;
603   --
604   -- Call the supporting pre-update operation
605   --
606   pre_update(p_rec);
607   --
608   -- Update the row.
609   --
610   update_dml(p_rec);
611   --
612   -- Call the supporting post-update operation
613   --
614   post_update(p_rec);
615   --
616   -- Call to raise any errors on multi-message list
617   --
618   hr_multi_message.end_validation_set;
619   --
620   -- If we are validating then raise the Validate_Enabled exception
621   --
622   If p_validate then
623     Raise HR_Api.Validate_Enabled;
624   End If;
625   --
626   hr_utility.set_location(' Leaving:'||l_proc, 10);
627 Exception
628   When HR_Api.Validate_Enabled Then
629     --
630     -- As the Validate_Enabled exception has been raised
631     -- we must rollback to the savepoint
632     --
633     p_rec := l_rec;
634     ROLLBACK TO upd_per_pea;
635 End upd;
636 --
637 -- ----------------------------------------------------------------------------
638 -- |---------------------------------< upd >----------------------------------|
639 -- ----------------------------------------------------------------------------
640 Procedure upd
641   (
642    p_person_analysis_id           in number,
643    p_analysis_criteria_id         in number           default hr_api.g_number,
644    p_comments                     in varchar2         default hr_api.g_varchar2,
645    p_date_from                    in date             default hr_api.g_date,
646    p_date_to                      in date             default hr_api.g_date,
647    p_id_flex_num                  in number           default hr_api.g_number,
648    p_request_id                   in number           default hr_api.g_number,
649    p_program_application_id       in number           default hr_api.g_number,
650    p_program_id                   in number           default hr_api.g_number,
651    p_program_update_date          in date             default hr_api.g_date,
652    p_attribute_category           in varchar2         default hr_api.g_varchar2,
653    p_attribute1                   in varchar2         default hr_api.g_varchar2,
654    p_attribute2                   in varchar2         default hr_api.g_varchar2,
655    p_attribute3                   in varchar2         default hr_api.g_varchar2,
656    p_attribute4                   in varchar2         default hr_api.g_varchar2,
657    p_attribute5                   in varchar2         default hr_api.g_varchar2,
658    p_attribute6                   in varchar2         default hr_api.g_varchar2,
659    p_attribute7                   in varchar2         default hr_api.g_varchar2,
660    p_attribute8                   in varchar2         default hr_api.g_varchar2,
661    p_attribute9                   in varchar2         default hr_api.g_varchar2,
662    p_attribute10                  in varchar2         default hr_api.g_varchar2,
663    p_attribute11                  in varchar2         default hr_api.g_varchar2,
664    p_attribute12                  in varchar2         default hr_api.g_varchar2,
665    p_attribute13                  in varchar2         default hr_api.g_varchar2,
666    p_attribute14                  in varchar2         default hr_api.g_varchar2,
667    p_attribute15                  in varchar2         default hr_api.g_varchar2,
668    p_attribute16                  in varchar2         default hr_api.g_varchar2,
669    p_attribute17                  in varchar2         default hr_api.g_varchar2,
670    p_attribute18                  in varchar2         default hr_api.g_varchar2,
671    p_attribute19                  in varchar2         default hr_api.g_varchar2,
672    p_attribute20                  in varchar2         default hr_api.g_varchar2,
673    p_object_version_number        in out nocopy number,
674    p_validate                     in boolean          default false
675   ) is
676 --
677   l_rec	  per_pea_shd.g_rec_type;
678   l_proc  varchar2(72) := g_package||'upd';
679 --
680 Begin
681   hr_utility.set_location('Entering:'||l_proc, 5);
682   --
683   -- Call conversion function to turn arguments into the
684   -- l_rec structure.
685   --
686   l_rec :=
687   per_pea_shd.convert_args
688   (
689    p_person_analysis_id,
690    hr_api.g_number,
691    p_analysis_criteria_id,
692    hr_api.g_number,
693    p_comments,
694    p_date_from,
695    p_date_to,
696    p_id_flex_num,
697    p_request_id,
698    p_program_application_id,
699    p_program_id,
700    p_program_update_date,
701    p_attribute_category,
702    p_attribute1,
703    p_attribute2,
704    p_attribute3,
705    p_attribute4,
706    p_attribute5,
707    p_attribute6,
708    p_attribute7,
709    p_attribute8,
710    p_attribute9,
711    p_attribute10,
712    p_attribute11,
713    p_attribute12,
714    p_attribute13,
715    p_attribute14,
716    p_attribute15,
717    p_attribute16,
718    p_attribute17,
719    p_attribute18,
720    p_attribute19,
721    p_attribute20,
722    p_object_version_number
723   );
724   --
725   -- Having converted the arguments into the
726   -- plsql record structure we call the corresponding record
727   -- business process.
728   --
729   upd(l_rec, p_validate);
730   p_object_version_number := l_rec.object_version_number;
731   --
732   hr_utility.set_location(' Leaving:'||l_proc, 10);
733 End upd;
734 --
735 end per_pea_upd;