DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_CRT_UPD

Source


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