DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_TPM_UPD

Source


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