DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_AST_UPD

Source


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