DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_LPE_UPD

Source


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