[Home] [Help]
PACKAGE BODY: APPS.PER_CPN_UPD
Source
1 Package Body per_cpn_upd as
2 /* $Header: pecpnrhi.pkb 120.0 2005/05/31 07:14:07 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_cpn_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 -- If any other error is reported, the error will be raised
39 --
40 -- Developer Implementation Notes:
41 -- The update 'set' attribute list should be modified if any of your
42 -- attributes are not updateable.
43 --
44 -- Access Status:
45 -- Internal Table Handler Use Only.
46 --
47 -- {End Of Comments}
48 -- ----------------------------------------------------------------------------
49 Procedure update_dml(p_rec in out nocopy per_cpn_shd.g_rec_type) is
50 --
51 l_proc varchar2(72) := g_package||'update_dml';
52 --
53 Begin
54 hr_utility.set_location('Entering:'||l_proc, 5);
55 --
56 -- Increment the object version
57 --
58 p_rec.object_version_number := p_rec.object_version_number + 1;
59 --
60 -- Update the per_competences Row
61 -- ngundura made changes as per pa requirements
62 -- competence_alias added in the update statement
63 update per_competences
64 set
65 competence_id = p_rec.competence_id,
66 name = p_rec.name,
67 object_version_number = p_rec.object_version_number,
68 description = p_rec.description,
69 date_from = p_rec.date_from,
70 date_to = p_rec.date_to,
71 behavioural_indicator = p_rec.behavioural_indicator,
72 certification_required = p_rec.certification_required,
73 evaluation_method = p_rec.evaluation_method,
74 renewal_period_frequency = p_rec.renewal_period_frequency,
75 renewal_period_units = p_rec.renewal_period_units,
76 min_level = p_rec.min_level,
77 max_level = p_rec.max_level,
78 rating_scale_id = p_rec.rating_scale_id,
79 attribute_category = p_rec.attribute_category,
80 attribute1 = p_rec.attribute1,
81 attribute2 = p_rec.attribute2,
82 attribute3 = p_rec.attribute3,
83 attribute4 = p_rec.attribute4,
84 attribute5 = p_rec.attribute5,
85 attribute6 = p_rec.attribute6,
86 attribute7 = p_rec.attribute7,
87 attribute8 = p_rec.attribute8,
88 attribute9 = p_rec.attribute9,
89 attribute10 = p_rec.attribute10,
90 attribute11 = p_rec.attribute11,
91 attribute12 = p_rec.attribute12,
92 attribute13 = p_rec.attribute13,
93 attribute14 = p_rec.attribute14,
94 attribute15 = p_rec.attribute15,
95 attribute16 = p_rec.attribute16,
96 attribute17 = p_rec.attribute17,
97 attribute18 = p_rec.attribute18,
98 attribute19 = p_rec.attribute19,
99 attribute20 = p_rec.attribute20,
100 competence_alias = p_rec.competence_alias,
101 competence_definition_id = p_rec.competence_definition_id
102 ,competence_cluster = p_rec.competence_cluster
103 ,unit_standard_id = p_rec.unit_standard_id
104 ,credit_type = p_rec.credit_type
105 ,credits = p_rec.credits
106 ,level_type = p_rec.level_type
107 ,level_number = p_rec.level_number
108 ,field = p_rec.field
109 ,sub_field = p_rec.sub_field
110 ,provider = p_rec.provider
111 ,qa_organization = p_rec.qa_organization
112 ,information_category = p_rec.information_category
113 ,information1 = p_rec.information1
114 ,information2 = p_rec.information2
115 ,information3 = p_rec.information3
116 ,information4 = p_rec.information4
117 ,information5 = p_rec.information5
118 ,information6 = p_rec.information6
119 ,information7 = p_rec.information7
120 ,information8 = p_rec.information8
121 ,information9 = p_rec.information9
122 ,information10 = p_rec.information10
123 ,information11 = p_rec.information11
124 ,information12 = p_rec.information12
125 ,information13 = p_rec.information13
126 ,information14 = p_rec.information14
127 ,information15 = p_rec.information15
128 ,information16 = p_rec.information16
129 ,information17 = p_rec.information17
130 ,information18 = p_rec.information18
131 ,information19 = p_rec.information19
132 ,information20 = p_rec.information20
133 where competence_id = p_rec.competence_id;
134 --
135 hr_utility.set_location(' Leaving:'||l_proc, 10);
136 --
137 Exception
138 When hr_api.check_integrity_violated Then
139 -- A check constraint has been violated
140 per_cpn_shd.constraint_error
141 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
142 When hr_api.parent_integrity_violated Then
143 -- Parent integrity has been violated
144 per_cpn_shd.constraint_error
145 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
146 When hr_api.unique_integrity_violated Then
147 -- Unique integrity has been violated
148 per_cpn_shd.constraint_error
149 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
150 When Others Then
151 Raise;
152 End update_dml;
153 --
154 -- ----------------------------------------------------------------------------
155 -- |------------------------------< pre_update >------------------------------|
156 -- ----------------------------------------------------------------------------
157 -- {Start Of Comments}
158 --
159 -- Description:
160 -- This private procedure contains any processing which is required before
161 -- the update dml.
162 --
163 -- Pre Conditions:
164 -- This is an internal procedure which is called from the upd procedure.
165 --
166 -- In Parameters:
167 -- A Pl/Sql record structre.
168 --
169 -- Post Success:
170 -- Processing continues.
171 --
172 -- Post Failure:
173 -- If an error has occurred, an error message and exception will be raised
174 -- but not handled.
175 --
176 -- Developer Implementation Notes:
177 -- Any pre-processing required before the update dml is issued should be
178 -- coded within this procedure. It is important to note that any 3rd party
179 -- maintenance should be reviewed before placing in this procedure.
180 --
181 -- Access Status:
182 -- Internal Table Handler Use Only.
183 --
184 -- {End Of Comments}
185 -- ----------------------------------------------------------------------------
186 Procedure pre_update(p_rec in per_cpn_shd.g_rec_type) is
187 --
188 l_proc varchar2(72) := g_package||'pre_update';
189 --
190 Begin
191 hr_utility.set_location('Entering:'||l_proc, 5);
192 --
193 hr_utility.set_location(' Leaving:'||l_proc, 10);
194 End pre_update;
195 --
196 -- ----------------------------------------------------------------------------
197 -- |-----------------------------< post_update >------------------------------|
198 -- ----------------------------------------------------------------------------
199 -- {Start Of Comments}
200 --
201 -- Description:
202 -- This private procedure contains any processing which is required after the
203 -- update dml.
204 --
205 -- Pre Conditions:
206 -- This is an internal procedure which is called from the upd procedure.
207 --
208 -- In Parameters:
209 -- A Pl/Sql record structre.
210 --
211 -- Post Success:
212 -- Processing continues.
213 --
214 -- Post Failure:
215 -- If an error has occurred, an error message and exception will be raised
216 -- but not handled.
217 --
218 -- Developer Implementation Notes:
219 -- Any post-processing required after the update dml is issued should be
220 -- coded within this procedure. It is important to note that any 3rd party
221 -- maintenance should be reviewed before placing in this procedure.
222 --
223 -- Access Status:
224 -- Internal Table Handler Use Only.
225 --
226 -- {End Of Comments}
227 -- ----------------------------------------------------------------------------
228 Procedure post_update(p_rec in per_cpn_shd.g_rec_type) is
229 --
230 l_proc varchar2(72) := g_package||'post_update';
231 --
232 Begin
233 hr_utility.set_location('Entering:'||l_proc, 5);
234 --
235 -- This is a hook point and the user hook for post_update is called here.
236 --
237 begin
238 -- ngundura made changes as per pa requirement
239 -- added two more parameters for competence_alias
240 per_cpn_rku.after_update (
241 p_competence_id => p_rec.competence_id ,
242 p_business_group_id => p_rec.business_group_id ,
243 p_object_version_number => p_rec.object_version_number ,
244 p_name => p_rec.name ,
245 p_description => p_rec.description ,
246 p_date_from => p_rec.date_from ,
247 p_date_to => p_rec.date_to ,
248 p_behavioural_indicator => p_rec.behavioural_indicator ,
249 p_certification_required => p_rec.certification_required ,
250 p_evaluation_method => p_rec.evaluation_method ,
251 p_renewal_period_frequency => p_rec.renewal_period_frequency ,
252 p_renewal_period_units => p_rec.renewal_period_units ,
253 p_max_level => p_rec.max_level ,
254 p_min_level => p_rec.min_level ,
255 p_rating_scale_id => p_rec.rating_scale_id ,
256 p_attribute_category => p_rec.attribute_category ,
257 p_attribute1 => p_rec.attribute1 ,
258 p_attribute2 => p_rec.attribute2 ,
259 p_attribute3 => p_rec.attribute3 ,
260 p_attribute4 => p_rec.attribute4 ,
261 p_attribute5 => p_rec.attribute5 ,
262 p_attribute6 => p_rec.attribute6 ,
263 p_attribute7 => p_rec.attribute7 ,
264 p_attribute8 => p_rec.attribute8 ,
265 p_attribute9 => p_rec.attribute9 ,
266 p_attribute10 => p_rec.attribute10 ,
267 p_attribute11 => p_rec.attribute11 ,
268 p_attribute12 => p_rec.attribute12 ,
269 p_attribute13 => p_rec.attribute13 ,
270 p_attribute14 => p_rec.attribute14 ,
271 p_attribute15 => p_rec.attribute15 ,
272 p_attribute16 => p_rec.attribute16 ,
273 p_attribute17 => p_rec.attribute17 ,
274 p_attribute18 => p_rec.attribute18 ,
275 p_attribute19 => p_rec.attribute19 ,
276 p_attribute20 => p_rec.attribute20 ,
277 p_competence_alias => p_rec.competence_alias,
278 p_competence_definition_id => p_rec.competence_definition_id,
279 p_competence_cluster => p_rec.competence_cluster ,
280 p_unit_standard_id => p_rec.unit_standard_id ,
281 p_credit_type => p_rec.credit_type ,
282 p_credits => p_rec.credits ,
283 p_level_type => p_rec.level_type ,
284 p_level_number => p_rec.level_number ,
285 p_field => p_rec.field ,
286 p_sub_field => p_rec.sub_field ,
287 p_provider => p_rec.provider ,
288 p_qa_organization => p_rec.qa_organization ,
289 p_information_category => p_rec.information_category ,
290 p_information1 => p_rec.information1 ,
291 p_information2 => p_rec.information2 ,
292 p_information3 => p_rec.information3 ,
293 p_information4 => p_rec.information4 ,
294 p_information5 => p_rec.information5 ,
295 p_information6 => p_rec.information6 ,
296 p_information7 => p_rec.information7 ,
297 p_information8 => p_rec.information8 ,
298 p_information9 => p_rec.information9 ,
299 p_information10 => p_rec.information10 ,
300 p_information11 => p_rec.information11 ,
301 p_information12 => p_rec.information12 ,
302 p_information13 => p_rec.information13 ,
303 p_information14 => p_rec.information14 ,
304 p_information15 => p_rec.information15 ,
305 p_information16 => p_rec.information16 ,
306 p_information17 => p_rec.information17 ,
307 p_information18 => p_rec.information18 ,
308 p_information19 => p_rec.information19 ,
309 p_information20 => p_rec.information20 ,
310 p_business_group_id_o => per_cpn_shd.g_old_rec.business_group_id ,
311 p_object_version_number_o => per_cpn_shd.g_old_rec.object_version_number ,
312 p_name_o => per_cpn_shd.g_old_rec.name ,
313 p_description_o => per_cpn_shd.g_old_rec.description ,
314 p_date_from_o => per_cpn_shd.g_old_rec.date_from ,
315 p_date_to_o => per_cpn_shd.g_old_rec.date_to ,
316 p_behavioural_indicator_o => per_cpn_shd.g_old_rec.behavioural_indicator ,
317 p_certification_required_o =>
318 per_cpn_shd.g_old_rec.certification_required ,
319 p_evaluation_method_o => per_cpn_shd.g_old_rec.evaluation_method ,
320 p_renewal_period_frequency_o =>
321 per_cpn_shd.g_old_rec.renewal_period_frequency ,
322 p_renewal_period_units_o => per_cpn_shd.g_old_rec.renewal_period_units ,
323 p_max_level_o => per_cpn_shd.g_old_rec.max_level ,
324 p_min_level_o => per_cpn_shd.g_old_rec.min_level ,
325 p_rating_scale_id_o => per_cpn_shd.g_old_rec.rating_scale_id ,
326 p_attribute_category_o => per_cpn_shd.g_old_rec.attribute_category ,
327 p_attribute1_o => per_cpn_shd.g_old_rec.attribute1 ,
328 p_attribute2_o => per_cpn_shd.g_old_rec.attribute2 ,
329 p_attribute3_o => per_cpn_shd.g_old_rec.attribute3 ,
330 p_attribute4_o => per_cpn_shd.g_old_rec.attribute4 ,
331 p_attribute5_o => per_cpn_shd.g_old_rec.attribute5 ,
332 p_attribute6_o => per_cpn_shd.g_old_rec.attribute6 ,
333 p_attribute7_o => per_cpn_shd.g_old_rec.attribute7 ,
334 p_attribute8_o => per_cpn_shd.g_old_rec.attribute8 ,
335 p_attribute9_o => per_cpn_shd.g_old_rec.attribute9 ,
336 p_attribute10_o => per_cpn_shd.g_old_rec.attribute10 ,
337 p_attribute11_o => per_cpn_shd.g_old_rec.attribute11 ,
338 p_attribute12_o => per_cpn_shd.g_old_rec.attribute12 ,
339 p_attribute13_o => per_cpn_shd.g_old_rec.attribute13 ,
340 p_attribute14_o => per_cpn_shd.g_old_rec.attribute14 ,
341 p_attribute15_o => per_cpn_shd.g_old_rec.attribute15 ,
342 p_attribute16_o => per_cpn_shd.g_old_rec.attribute16 ,
343 p_attribute17_o => per_cpn_shd.g_old_rec.attribute17 ,
344 p_attribute18_o => per_cpn_shd.g_old_rec.attribute18 ,
345 p_attribute19_o => per_cpn_shd.g_old_rec.attribute19 ,
346 p_attribute20_o => per_cpn_shd.g_old_rec.attribute20 ,
347 p_competence_alias_o => per_cpn_shd.g_old_rec.competence_alias,
348 p_competence_definition_id_o => per_cpn_shd.g_old_rec.competence_definition_id
349 ,p_competence_cluster_o => per_cpn_shd.g_old_rec.competence_cluster
350 ,p_unit_standard_id_o => per_cpn_shd.g_old_rec.unit_standard_id
351 ,p_credit_type_o => per_cpn_shd.g_old_rec.credit_type
352 ,p_credits_o => per_cpn_shd.g_old_rec.credits
353 ,p_level_type_o => per_cpn_shd.g_old_rec.level_type
354 ,p_level_number_o => per_cpn_shd.g_old_rec.level_number
355 ,p_field_o => per_cpn_shd.g_old_rec.field
356 ,p_sub_field_o => per_cpn_shd.g_old_rec.sub_field
357 ,p_provider_o => per_cpn_shd.g_old_rec.provider
358 ,p_qa_organization_o => per_cpn_shd.g_old_rec.qa_organization
359 ,p_information_category_o => per_cpn_shd.g_old_rec.information_category
360 ,p_information1_o => per_cpn_shd.g_old_rec.information1
361 ,p_information2_o => per_cpn_shd.g_old_rec.information2
362 ,p_information3_o => per_cpn_shd.g_old_rec.information3
363 ,p_information4_o => per_cpn_shd.g_old_rec.information4
364 ,p_information5_o => per_cpn_shd.g_old_rec.information5
365 ,p_information6_o => per_cpn_shd.g_old_rec.information6
366 ,p_information7_o => per_cpn_shd.g_old_rec.information7
367 ,p_information8_o => per_cpn_shd.g_old_rec.information8
368 ,p_information9_o => per_cpn_shd.g_old_rec.information9
369 ,p_information10_o => per_cpn_shd.g_old_rec.information10
370 ,p_information11_o => per_cpn_shd.g_old_rec.information11
371 ,p_information12_o => per_cpn_shd.g_old_rec.information12
372 ,p_information13_o => per_cpn_shd.g_old_rec.information13
373 ,p_information14_o => per_cpn_shd.g_old_rec.information14
374 ,p_information15_o => per_cpn_shd.g_old_rec.information15
375 ,p_information16_o => per_cpn_shd.g_old_rec.information16
376 ,p_information17_o => per_cpn_shd.g_old_rec.information17
377 ,p_information18_o => per_cpn_shd.g_old_rec.information18
378 ,p_information19_o => per_cpn_shd.g_old_rec.information19
379 ,p_information20_o => per_cpn_shd.g_old_rec.information20
380 );
381
382 exception
383 when hr_api.cannot_find_prog_unit then
384 hr_api.cannot_find_prog_unit_error
385 ( p_module_name => 'PER_COMPETENCES'
386 ,p_hook_type => 'AU'
387 );
388 end;
389 -- End of API User Hook for post_update
390 --
391 hr_utility.set_location(' Leaving:'||l_proc, 10);
392 End post_update;
393 --
394 -- ----------------------------------------------------------------------------
395 -- |-----------------------------< convert_defs >-----------------------------|
396 -- ----------------------------------------------------------------------------
397 -- {Start Of Comments}
398 --
399 -- Description:
400 -- The Convert_Defs procedure has one very important function:
401 -- It must return the record structure for the row with all system defaulted
402 -- values converted into its corresponding parameter value for update. When
403 -- we attempt to update a row through the Upd process , certain
404 -- parameters can be defaulted which enables flexibility in the calling of
405 -- the upd process (e.g. only attributes which need to be updated need to be
406 -- specified). For the upd process to determine which attributes
407 -- have NOT been specified we need to check if the parameter has a reserved
408 -- system default value. Therefore, for all parameters which have a
409 -- corresponding reserved system default mechanism specified we need to
410 -- check if a system default is being used. If a system default is being
411 -- used then we convert the defaulted value into its corresponding attribute
412 -- value held in the g_old_rec data structure.
413 --
414 -- Pre Conditions:
415 -- This private function can only be called from the upd process.
416 --
417 -- In Parameters:
418 -- A Pl/Sql record structre.
419 --
420 -- Post Success:
421 -- The record structure will be returned with all system defaulted parameter
422 -- values converted into its current row attribute value.
423 --
424 -- Post Failure:
425 -- No direct error handling is required within this function. Any possible
426 -- errors within this procedure will be a PL/SQL value error due to conversion
427
428 -- of datatypes or data lengths.
429 --
430 -- Developer Implementation Notes:
431 -- None.
432 --
433 -- Access Status:
434 -- Internal Table Handler Use Only.
435 --
436 -- {End Of Comments}
437 -- ---------------------------------------------------------------------------
438 Procedure convert_defs(p_rec in out nocopy per_cpn_shd.g_rec_type) is
439 --
440 l_proc varchar2(72) := g_package||'convert_defs';
441 --
442 Begin
443 --
444 hr_utility.set_location('Entering:'||l_proc, 5);
445 --
446 -- We must now examine each argument value in the
447 -- p_rec plsql record structure
448 -- to see if a system default is being used. If a system default
449 -- is being used then we must set to the 'current' argument value.
450 --
451 If (p_rec.name = hr_api.g_varchar2) then
452 p_rec.name :=
453 per_cpn_shd.g_old_rec.name;
454 End If;
455 If (p_rec.business_group_id = hr_api.g_number) then
456 p_rec.business_group_id :=
457 per_cpn_shd.g_old_rec.business_group_id;
458 End If;
459 If (p_rec.description = hr_api.g_varchar2) then
460 p_rec.description :=
461 per_cpn_shd.g_old_rec.description;
462 End If;
463 If (p_rec.date_from = hr_api.g_date) then
464 p_rec.date_from :=
465 per_cpn_shd.g_old_rec.date_from;
466 End If;
467 If (p_rec.date_to = hr_api.g_date) then
468 p_rec.date_to :=
469 per_cpn_shd.g_old_rec.date_to;
470 End If;
471 If (p_rec.behavioural_indicator = hr_api.g_varchar2) then
472 p_rec.behavioural_indicator :=
473 per_cpn_shd.g_old_rec.behavioural_indicator;
474 End If;
475 If (p_rec.certification_required = hr_api.g_varchar2) then
476 p_rec.certification_required :=
477 per_cpn_shd.g_old_rec.certification_required;
478 End If;
479 If (p_rec.evaluation_method = hr_api.g_varchar2) then
480 p_rec.evaluation_method :=
481 per_cpn_shd.g_old_rec.evaluation_method;
482 End If;
483 If (p_rec.renewal_period_frequency = hr_api.g_number) then
484 p_rec.renewal_period_frequency :=
485 per_cpn_shd.g_old_rec.renewal_period_frequency;
486 End If;
487 If (p_rec.renewal_period_units = hr_api.g_varchar2) then
488 p_rec.renewal_period_units :=
489 per_cpn_shd.g_old_rec.renewal_period_units;
490 End If;
491 If (p_rec.min_level = hr_api.g_number) then
492 p_rec.min_level :=
493 per_cpn_shd.g_old_rec.min_level;
494 End If;
495 If (p_rec.max_level = hr_api.g_number) then
496 p_rec.max_level :=
497 per_cpn_shd.g_old_rec.max_level;
498 End If;
499 If (p_rec.rating_scale_id = hr_api.g_number) then
500 p_rec.rating_scale_id :=
501 per_cpn_shd.g_old_rec.rating_scale_id;
502 End If;
503 If (p_rec.attribute_category = hr_api.g_varchar2) then
504 p_rec.attribute_category :=
505 per_cpn_shd.g_old_rec.attribute_category;
506 End If;
507 If (p_rec.attribute1 = hr_api.g_varchar2) then
508 p_rec.attribute1 :=
509 per_cpn_shd.g_old_rec.attribute1;
510 End If;
511 If (p_rec.attribute2 = hr_api.g_varchar2) then
512 p_rec.attribute2 :=
513 per_cpn_shd.g_old_rec.attribute2;
514 End If;
515 If (p_rec.attribute3 = hr_api.g_varchar2) then
516 p_rec.attribute3 :=
517 per_cpn_shd.g_old_rec.attribute3;
518 End If;
519 If (p_rec.attribute4 = hr_api.g_varchar2) then
520 p_rec.attribute4 :=
521 per_cpn_shd.g_old_rec.attribute4;
522 End If;
523 If (p_rec.attribute5 = hr_api.g_varchar2) then
524 p_rec.attribute5 :=
525 per_cpn_shd.g_old_rec.attribute5;
526 End If;
527 If (p_rec.attribute6 = hr_api.g_varchar2) then
528 p_rec.attribute6 :=
529 per_cpn_shd.g_old_rec.attribute6;
530 End If;
531 If (p_rec.attribute7 = hr_api.g_varchar2) then
532 p_rec.attribute7 :=
533 per_cpn_shd.g_old_rec.attribute7;
534 End If;
535 If (p_rec.attribute8 = hr_api.g_varchar2) then
536 p_rec.attribute8 :=
537 per_cpn_shd.g_old_rec.attribute8;
538 End If;
539 If (p_rec.attribute9 = hr_api.g_varchar2) then
540 p_rec.attribute9 :=
541 per_cpn_shd.g_old_rec.attribute9;
542 End If;
543 If (p_rec.attribute10 = hr_api.g_varchar2) then
544 p_rec.attribute10 :=
545 per_cpn_shd.g_old_rec.attribute10;
546 End If;
547 If (p_rec.attribute11 = hr_api.g_varchar2) then
548 p_rec.attribute11 :=
549 per_cpn_shd.g_old_rec.attribute11;
550 eND iF;
551 If (p_rec.attribute12 = hr_api.g_varchar2) then
552 p_rec.attribute12 :=
553 per_cpn_shd.g_old_rec.attribute12;
554 End If;
555 If (p_rec.attribute13 = hr_api.g_varchar2) then
556 p_rec.attribute13 :=
557 per_cpn_shd.g_old_rec.attribute13;
558 End If;
559 If (p_rec.attribute14 = hr_api.g_varchar2) then
560 p_rec.attribute14 :=
561 per_cpn_shd.g_old_rec.attribute14;
562 End If;
563 If (p_rec.attribute15 = hr_api.g_varchar2) then
564 p_rec.attribute15 :=
565 per_cpn_shd.g_old_rec.attribute15;
566 End If;
567 If (p_rec.attribute16 = hr_api.g_varchar2) then
568 p_rec.attribute16 :=
569 per_cpn_shd.g_old_rec.attribute16;
570 End If;
571 If (p_rec.attribute17 = hr_api.g_varchar2) then
572 p_rec.attribute17 :=
573 per_cpn_shd.g_old_rec.attribute17;
574 End If;
575 If (p_rec.attribute18 = hr_api.g_varchar2) then
576 p_rec.attribute18 :=
577 per_cpn_shd.g_old_rec.attribute18;
578 End If;
579 If (p_rec.attribute19 = hr_api.g_varchar2) then
580 p_rec.attribute19 :=
581 per_cpn_shd.g_old_rec.attribute19;
582 End If;
583 If (p_rec.attribute20 = hr_api.g_varchar2) then
584 p_rec.attribute20 :=
585 per_cpn_shd.g_old_rec.attribute20;
586 End If;
587 -- ngundura changes as per pa requirements
588 If (p_rec.competence_alias = hr_api.g_varchar2) then
589 p_rec.competence_alias :=
590 per_cpn_shd.g_old_rec.competence_alias;
591 End If;
592 If (p_rec.competence_definition_id = hr_api.g_number) then
593 p_rec.competence_definition_id :=
594 per_cpn_shd.g_old_rec.competence_definition_id;
595 End If;
596 --
597 -- BUG3356369
598 --
599 If (p_rec.competence_cluster = hr_api.g_varchar2) then
600 p_rec.competence_cluster :=
601 per_cpn_shd.g_old_rec.competence_cluster;
602 End If;
603 If (p_rec.unit_standard_id = hr_api.g_varchar2) then
604 p_rec.unit_standard_id :=
605 per_cpn_shd.g_old_rec.unit_standard_id;
606 End If;
607 If (p_rec.credit_type = hr_api.g_varchar2) then
608 p_rec.credit_type :=
609 per_cpn_shd.g_old_rec.credit_type;
610 End If;
611 If (p_rec.credits = hr_api.g_number) then
612 p_rec.credits :=
613 per_cpn_shd.g_old_rec.credits;
614 End If;
615 If (p_rec.level_type = hr_api.g_varchar2) then
616 p_rec.level_type :=
617 per_cpn_shd.g_old_rec.level_type;
618 End If;
619 If (p_rec.level_number = hr_api.g_number) then
620 p_rec.level_number :=
621 per_cpn_shd.g_old_rec.level_number;
622 End If;
623 If (p_rec.field = hr_api.g_varchar2) then
624 p_rec.field :=
625 per_cpn_shd.g_old_rec.field ;
626 End If;
627 If (p_rec.sub_field = hr_api.g_varchar2) then
628 p_rec.sub_field :=
629 per_cpn_shd.g_old_rec.sub_field;
630 End If;
631 If (p_rec.provider = hr_api.g_varchar2) then
632 p_rec.provider :=
633 per_cpn_shd.g_old_rec.provider;
634 End If;
635 If (p_rec.qa_organization = hr_api.g_varchar2) then
636 p_rec.qa_organization :=
637 per_cpn_shd.g_old_rec.qa_organization;
638 End If;
639 If (p_rec.information_category = hr_api.g_varchar2) then
640 p_rec.information_category :=
641 per_cpn_shd.g_old_rec.information_category;
642 End If;
643 If (p_rec.information1 = hr_api.g_varchar2) then
644 p_rec.information1 :=
645 per_cpn_shd.g_old_rec.information1;
646 End If;
647 If (p_rec.information2 = hr_api.g_varchar2) then
648 p_rec.information2 :=
649 per_cpn_shd.g_old_rec.information2;
650 End If;
651 If (p_rec.information3 = hr_api.g_varchar2) then
652 p_rec.information3 :=
653 per_cpn_shd.g_old_rec.information3;
654 End If;
655 If (p_rec.information4 = hr_api.g_varchar2) then
656 p_rec.information4 :=
657 per_cpn_shd.g_old_rec.information4;
658 End If;
659 If (p_rec.information5 = hr_api.g_varchar2) then
660 p_rec.information5 :=
661 per_cpn_shd.g_old_rec.information5;
662 End If;
663 If (p_rec.information6 = hr_api.g_varchar2) then
664 p_rec.information6 :=
665 per_cpn_shd.g_old_rec.information6;
666 End If;
667 If (p_rec.information7 = hr_api.g_varchar2) then
668 p_rec.information7 :=
669 per_cpn_shd.g_old_rec.information7;
670 End If;
671 If (p_rec.information8 = hr_api.g_varchar2) then
672 p_rec.information8 :=
673 per_cpn_shd.g_old_rec.information8;
674 End If;
675 If (p_rec.information9 = hr_api.g_varchar2) then
676 p_rec.information9 :=
677 per_cpn_shd.g_old_rec.information9;
678 End If;
679 If (p_rec.information10 = hr_api.g_varchar2) then
680 p_rec.information10 :=
681 per_cpn_shd.g_old_rec.information10;
682 End If;
683 If (p_rec.information11 = hr_api.g_varchar2) then
684 p_rec.information11 :=
685 per_cpn_shd.g_old_rec.information11;
686 End If;
687 If (p_rec.information12 = hr_api.g_varchar2) then
688 p_rec.information12 :=
689 per_cpn_shd.g_old_rec.information12;
690 End If;
691 If (p_rec.information13 = hr_api.g_varchar2) then
692 p_rec.information13 :=
693 per_cpn_shd.g_old_rec.information13;
694 End If;
695 If (p_rec.information14 = hr_api.g_varchar2) then
696 p_rec.information14 :=
697 per_cpn_shd.g_old_rec.information14;
698 End If;
699 If (p_rec.information15 = hr_api.g_varchar2) then
700 p_rec.information15 :=
701 per_cpn_shd.g_old_rec.information15;
702 End If;
703 If (p_rec.information16 = hr_api.g_varchar2) then
704 p_rec.information16 :=
705 per_cpn_shd.g_old_rec.information16;
706 End If;
707 If (p_rec.information17 = hr_api.g_varchar2) then
708 p_rec.information17 :=
709 per_cpn_shd.g_old_rec.information17;
710 End If;
711 If (p_rec.information18 = hr_api.g_varchar2) then
712 p_rec.information18 :=
713 per_cpn_shd.g_old_rec.information18;
714 End If;
715 If (p_rec.information19 = hr_api.g_varchar2) then
716 p_rec.information19 :=
717 per_cpn_shd.g_old_rec.information19;
718 End If;
719 If (p_rec.information20 = hr_api.g_varchar2) then
720 p_rec.information20 :=
721 per_cpn_shd.g_old_rec.information20;
722 End If;
723 --
724 hr_utility.set_location(' Leaving:'||l_proc, 10);
725 --
726 End convert_defs;
727 --
728 -- ----------------------------------------------------------------------------
729 -- |---------------------------------< upd >----------------------------------|
730 -- ----------------------------------------------------------------------------
731 Procedure upd
732 (
733 p_rec in out nocopy per_cpn_shd.g_rec_type,
734 p_effective_date in date default null,
735 p_validate in boolean default false
736 ) is
737 --
738 l_proc varchar2(72) := g_package||'upd';
739 --
740 Begin
741 hr_utility.set_location('Entering:'||l_proc, 5);
742 --
743 -- Determine if the business process is to be validated.
744 --
745 If p_validate then
746 --
747 -- Issue the savepoint.
748 --
749 SAVEPOINT upd_per_cpn;
750 End If;
751 --
752 -- We must lock the row which we need to update.
753 --
754 per_cpn_shd.lck
755 (
756 p_rec.competence_id,
757 p_rec.object_version_number
758 );
759 --
760 -- 1. During an update system defaults are used to determine if
761 -- arguments have been defaulted or not. We must therefore
762 -- derive the full record structure values to be updated.
763 --
764 -- 2. Call the supporting update validate operations.
765 --
766 convert_defs(p_rec);
767 per_cpn_bus.update_validate(p_rec,p_effective_date);
768 --
769 -- Call the supporting pre-update operation
770 --
771 pre_update(p_rec);
772 --
773 -- Update the row.
774 --
775 update_dml(p_rec);
776 --
777 -- Call the supporting post-update operation
778 --
779 post_update(p_rec);
780 --
781 -- If we are validating then raise the Validate_Enabled exception
782 --
783 If p_validate then
784 Raise HR_Api.Validate_Enabled;
785 End If;
786 --
787 hr_utility.set_location(' Leaving:'||l_proc, 10);
788 Exception
789 When HR_Api.Validate_Enabled Then
790 --
791 -- As the Validate_Enabled exception has been raised
792 -- we must rollback to the savepoint
793 --
794 ROLLBACK TO upd_per_cpn;
795 End upd;
796 --
797 -- ----------------------------------------------------------------------------
798 -- |---------------------------------< upd >----------------------------------|
799 -- ----------------------------------------------------------------------------
800 Procedure upd
801 (
802 p_competence_id in number,
803 p_name in varchar2 default hr_api.g_varchar2,
804 p_object_version_number in out nocopy number,
805 p_description in varchar2 default hr_api.g_varchar2,
806 p_date_from in date default hr_api.g_date,
807 p_date_to in date default hr_api.g_date,
808 p_behavioural_indicator in varchar2 default hr_api.g_varchar2,
809 p_certification_required in varchar2 default hr_api.g_varchar2,
810 p_evaluation_method in varchar2 default hr_api.g_varchar2,
811 p_renewal_period_frequency in number default hr_api.g_number,
812 p_renewal_period_units in varchar2 default hr_api.g_varchar2,
813 p_min_level in number default hr_api.g_number,
814 p_max_level in number default hr_api.g_number,
815 p_rating_scale_id in number default hr_api.g_number,
816 p_attribute_category in varchar2 default hr_api.g_varchar2,
817 p_attribute1 in varchar2 default hr_api.g_varchar2,
818 p_attribute2 in varchar2 default hr_api.g_varchar2,
819 p_attribute3 in varchar2 default hr_api.g_varchar2,
820 p_attribute4 in varchar2 default hr_api.g_varchar2,
821 p_attribute5 in varchar2 default hr_api.g_varchar2,
822 p_attribute6 in varchar2 default hr_api.g_varchar2,
823 p_attribute7 in varchar2 default hr_api.g_varchar2,
824 p_attribute8 in varchar2 default hr_api.g_varchar2,
825 p_attribute9 in varchar2 default hr_api.g_varchar2,
826 p_attribute10 in varchar2 default hr_api.g_varchar2,
827 p_attribute11 in varchar2 default hr_api.g_varchar2,
828 p_attribute12 in varchar2 default hr_api.g_varchar2,
829 p_attribute13 in varchar2 default hr_api.g_varchar2,
830 p_attribute14 in varchar2 default hr_api.g_varchar2,
831 p_attribute15 in varchar2 default hr_api.g_varchar2,
832 p_attribute16 in varchar2 default hr_api.g_varchar2,
833 p_attribute17 in varchar2 default hr_api.g_varchar2,
834 p_attribute18 in varchar2 default hr_api.g_varchar2,
835 p_attribute19 in varchar2 default hr_api.g_varchar2,
836 p_attribute20 in varchar2 default hr_api.g_varchar2,
837 p_effective_date in date ,
838 p_validate in boolean default false,
839 p_competence_alias in varchar2 default hr_api.g_varchar2,
840 p_competence_definition_id in number
841 ,p_competence_cluster in varchar2 default hr_api.g_varchar2
842 ,p_unit_standard_id in varchar2 default hr_api.g_varchar2
843 ,p_credit_type in varchar2 default hr_api.g_varchar2
844 ,p_credits in number default hr_api.g_number
845 ,p_level_type in varchar2 default hr_api.g_varchar2
846 ,p_level_number in number default hr_api.g_number
847 ,p_field in varchar2 default hr_api.g_varchar2
848 ,p_sub_field in varchar2 default hr_api.g_varchar2
849 ,p_provider in varchar2 default hr_api.g_varchar2
850 ,p_qa_organization in varchar2 default hr_api.g_varchar2
851 ,p_information_category in varchar2 default hr_api.g_varchar2
852 ,p_information1 in varchar2 default hr_api.g_varchar2
853 ,p_information2 in varchar2 default hr_api.g_varchar2
854 ,p_information3 in varchar2 default hr_api.g_varchar2
855 ,p_information4 in varchar2 default hr_api.g_varchar2
856 ,p_information5 in varchar2 default hr_api.g_varchar2
857 ,p_information6 in varchar2 default hr_api.g_varchar2
858 ,p_information7 in varchar2 default hr_api.g_varchar2
859 ,p_information8 in varchar2 default hr_api.g_varchar2
860 ,p_information9 in varchar2 default hr_api.g_varchar2
861 ,p_information10 in varchar2 default hr_api.g_varchar2
862 ,p_information11 in varchar2 default hr_api.g_varchar2
863 ,p_information12 in varchar2 default hr_api.g_varchar2
864 ,p_information13 in varchar2 default hr_api.g_varchar2
865 ,p_information14 in varchar2 default hr_api.g_varchar2
866 ,p_information15 in varchar2 default hr_api.g_varchar2
867 ,p_information16 in varchar2 default hr_api.g_varchar2
868 ,p_information17 in varchar2 default hr_api.g_varchar2
869 ,p_information18 in varchar2 default hr_api.g_varchar2
870 ,p_information19 in varchar2 default hr_api.g_varchar2
871 ,p_information20 in varchar2 default hr_api.g_varchar2
872
873 ) is
874 --
875 l_rec per_cpn_shd.g_rec_type;
876 l_proc varchar2(72) := g_package||'upd';
877 --
878 Begin
879 hr_utility.set_location('Entering:'||l_proc, 5);
880 --
881 -- Call conversion function to turn arguments into the
882 -- l_rec structure.
883 --
884 l_rec :=
885 per_cpn_shd.convert_args
886 (
887 p_competence_id,
888 p_name,
889 hr_api.g_number,
890 p_object_version_number,
891 p_description,
892 p_date_from,
893 p_date_to,
894 p_behavioural_indicator,
895 p_certification_required,
896 p_evaluation_method,
897 p_renewal_period_frequency,
898 p_renewal_period_units,
899 p_min_level,
900 p_max_level,
901 p_rating_scale_id,
902 p_attribute_category,
903 p_attribute1,
904 p_attribute2,
905 p_attribute3,
906 p_attribute4,
907 p_attribute5,
908 p_attribute6,
909 p_attribute7,
910 p_attribute8,
911 p_attribute9,
912 p_attribute10,
913 p_attribute11,
914 p_attribute12,
915 p_attribute13,
916 p_attribute14,
917 p_attribute15,
918 p_attribute16,
919 p_attribute17,
920 p_attribute18,
921 p_attribute19,
922 p_attribute20,
923 p_competence_alias,
924 p_competence_definition_id
925 ,p_competence_cluster -- BUG3356369
926 ,p_unit_standard_id
927 ,p_credit_type
928 ,p_credits
929 ,p_level_type
930 ,p_level_number
931 ,p_field
932 ,p_sub_field
933 ,p_provider
934 ,p_qa_organization
935 ,p_information_category
936 ,p_information1
937 ,p_information2
938 ,p_information3
939 ,p_information4
940 ,p_information5
941 ,p_information6
942 ,p_information7
943 ,p_information8
944 ,p_information9
945 ,p_information10
946 ,p_information11
947 ,p_information12
948 ,p_information13
949 ,p_information14
950 ,p_information15
951 ,p_information16
952 ,p_information17
953 ,p_information18
954 ,p_information19
955 ,p_information20
956 );
957 --
958 -- Having converted the arguments into the
959 -- plsql record structure we call the corresponding record
960 -- business process.
961 --
962 upd(l_rec, p_effective_date, p_validate);
963 p_object_version_number := l_rec.object_version_number;
964 --
965 hr_utility.set_location(' Leaving:'||l_proc, 10);
966 End upd;
967 --
968 end per_cpn_upd;