[Home] [Help]
PACKAGE BODY: APPS.OTA_TPC_UPD
Source
1 Package Body ota_tpc_upd as
2 /* $Header: ottpcrhi.pkb 115.5 2003/06/17 14:27:43 sfmorris noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ota_tpc_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_tpc_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_training_plan_costs Row
69 --
70 update ota_training_plan_costs
71 set
72 training_plan_cost_id = p_rec.training_plan_cost_id
73 ,amount = p_rec.amount
74 ,currency_code = p_rec.currency_code
75 ,object_version_number = p_rec.object_version_number
76 ,attribute_category = p_rec.attribute_category
77 ,attribute1 = p_rec.attribute1
78 ,attribute2 = p_rec.attribute2
79 ,attribute3 = p_rec.attribute3
80 ,attribute4 = p_rec.attribute4
81 ,attribute5 = p_rec.attribute5
82 ,attribute6 = p_rec.attribute6
83 ,attribute7 = p_rec.attribute7
84 ,attribute8 = p_rec.attribute8
85 ,attribute9 = p_rec.attribute9
86 ,attribute10 = p_rec.attribute10
87 ,attribute11 = p_rec.attribute11
88 ,attribute12 = p_rec.attribute12
89 ,attribute13 = p_rec.attribute13
90 ,attribute14 = p_rec.attribute14
91 ,attribute15 = p_rec.attribute15
92 ,attribute16 = p_rec.attribute16
93 ,attribute17 = p_rec.attribute17
94 ,attribute18 = p_rec.attribute18
95 ,attribute19 = p_rec.attribute19
96 ,attribute20 = p_rec.attribute20
97 ,attribute21 = p_rec.attribute21
98 ,attribute22 = p_rec.attribute22
99 ,attribute23 = p_rec.attribute23
100 ,attribute24 = p_rec.attribute24
101 ,attribute25 = p_rec.attribute25
102 ,attribute26 = p_rec.attribute26
103 ,attribute27 = p_rec.attribute27
104 ,attribute28 = p_rec.attribute28
105 ,attribute29 = p_rec.attribute29
106 ,attribute30 = p_rec.attribute30
107 ,information_category = p_rec.information_category
108 ,tp_cost_information1 = p_rec.tp_cost_information1
109 ,tp_cost_information2 = p_rec.tp_cost_information2
110 ,tp_cost_information3 = p_rec.tp_cost_information3
111 ,tp_cost_information4 = p_rec.tp_cost_information4
112 ,tp_cost_information5 = p_rec.tp_cost_information5
113 ,tp_cost_information6 = p_rec.tp_cost_information6
114 ,tp_cost_information7 = p_rec.tp_cost_information7
115 ,tp_cost_information8 = p_rec.tp_cost_information8
116 ,tp_cost_information9 = p_rec.tp_cost_information9
117 ,tp_cost_information10 = p_rec.tp_cost_information10
118 ,tp_cost_information11 = p_rec.tp_cost_information11
119 ,tp_cost_information12 = p_rec.tp_cost_information12
120 ,tp_cost_information13 = p_rec.tp_cost_information13
121 ,tp_cost_information14 = p_rec.tp_cost_information14
122 ,tp_cost_information15 = p_rec.tp_cost_information15
123 ,tp_cost_information16 = p_rec.tp_cost_information16
124 ,tp_cost_information17 = p_rec.tp_cost_information17
125 ,tp_cost_information18 = p_rec.tp_cost_information18
126 ,tp_cost_information19 = p_rec.tp_cost_information19
127 ,tp_cost_information20 = p_rec.tp_cost_information20
128 ,tp_cost_information21 = p_rec.tp_cost_information21
129 ,tp_cost_information22 = p_rec.tp_cost_information22
130 ,tp_cost_information23 = p_rec.tp_cost_information23
131 ,tp_cost_information24 = p_rec.tp_cost_information24
132 ,tp_cost_information25 = p_rec.tp_cost_information25
133 ,tp_cost_information26 = p_rec.tp_cost_information26
134 ,tp_cost_information27 = p_rec.tp_cost_information27
135 ,tp_cost_information28 = p_rec.tp_cost_information28
136 ,tp_cost_information29 = p_rec.tp_cost_information29
137 ,tp_cost_information30 = p_rec.tp_cost_information30
138 where training_plan_cost_id = p_rec.training_plan_cost_id;
139 --
140 --
141 --
142 hr_utility.set_location(' Leaving:'||l_proc, 10);
143 --
144 Exception
145 When hr_api.check_integrity_violated Then
146 -- A check constraint has been violated
147 --
148 ota_tpc_shd.constraint_error
149 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
150 When hr_api.parent_integrity_violated Then
151 -- Parent integrity has been violated
152 --
153 ota_tpc_shd.constraint_error
154 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
155 When hr_api.unique_integrity_violated Then
156 -- Unique integrity has been violated
157 --
158 ota_tpc_shd.constraint_error
159 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
160 When Others Then
161 --
162 Raise;
163 End update_dml;
164 --
165 -- ----------------------------------------------------------------------------
166 -- |------------------------------< pre_update >------------------------------|
167 -- ----------------------------------------------------------------------------
168 -- {Start Of Comments}
169 --
170 -- Description:
171 -- This private procedure contains any processing which is required before
172 -- the update dml.
173 --
174 -- Prerequisites:
175 -- This is an internal procedure which is called from the upd procedure.
176 --
177 -- In Parameters:
178 -- A Pl/Sql record structure.
179 --
180 -- Post Success:
181 -- Processing continues.
182 --
183 -- Post Failure:
184 -- If an error has occurred, an error message and exception wil be raised
185 -- but not handled.
186 --
187 -- Developer Implementation Notes:
188 -- Any pre-processing required before the update dml is issued should be
189 -- coded within this procedure. It is important to note that any 3rd party
190 -- maintenance should be reviewed before placing in this procedure.
191 --
192 -- Access Status:
193 -- Internal Row Handler Use Only.
194 --
195 -- {End Of Comments}
196 -- ----------------------------------------------------------------------------
197 Procedure pre_update
198 (p_rec in ota_tpc_shd.g_rec_type
199 ) is
200 --
201 l_proc varchar2(72) := g_package||'pre_update';
202 --
203 Begin
204 hr_utility.set_location('Entering:'||l_proc, 5);
205 --
206 hr_utility.set_location(' Leaving:'||l_proc, 10);
207 End pre_update;
208 --
209 -- ----------------------------------------------------------------------------
210 -- |-----------------------------< post_update >------------------------------|
211 -- ----------------------------------------------------------------------------
212 -- {Start Of Comments}
213 --
214 -- Description:
215 -- This private procedure contains any processing which is required after the
216 -- update dml.
217 --
218 -- Prerequisites:
219 -- This is an internal procedure which is called from the upd procedure.
220 --
221 -- In Parameters:
222 -- A Pl/Sql record structure.
223 --
224 -- Post Success:
225 -- Processing continues.
226 --
227 -- Post Failure:
228 -- If an error has occurred, an error message and exception will be raised
229 -- but not handled.
230 --
231 -- Developer Implementation Notes:
232 -- Any post-processing required after the update dml is issued should be
233 -- coded within this procedure. It is important to note that any 3rd party
234 -- maintenance should be reviewed before placing in this procedure.
235 --
236 -- Access Status:
237 -- Internal Row Handler Use Only.
238 --
239 -- {End Of Comments}
240 -- ----------------------------------------------------------------------------
241 Procedure post_update
242 (p_effective_date in date
243 ,p_rec in ota_tpc_shd.g_rec_type
244 ) is
245 --
246 l_proc varchar2(72) := g_package||'post_update';
247 --
248 Begin
249 hr_utility.set_location('Entering:'||l_proc, 5);
250 begin
251 --
252 ota_tpc_rku.after_update
253 (p_effective_date => p_effective_date
254 ,p_training_plan_cost_id
255 => p_rec.training_plan_cost_id
256 ,p_tp_measurement_type_id
257 => p_rec.tp_measurement_type_id
258 ,p_training_plan_id
259 => p_rec.training_plan_id
260 ,p_booking_id
261 => p_rec.booking_id
262 ,p_event_id
263 => p_rec.event_id
264 ,p_amount
265 => p_rec.amount
266 ,p_currency_code
267 => p_rec.currency_code
268 ,p_business_group_id
269 => p_rec.business_group_id
270 ,p_object_version_number
271 => p_rec.object_version_number
272 ,p_attribute_category
273 => p_rec.attribute_category
274 ,p_attribute1
275 => p_rec.attribute1
276 ,p_attribute2
277 => p_rec.attribute2
278 ,p_attribute3
279 => p_rec.attribute3
280 ,p_attribute4
281 => p_rec.attribute4
282 ,p_attribute5
283 => p_rec.attribute5
284 ,p_attribute6
285 => p_rec.attribute6
286 ,p_attribute7
287 => p_rec.attribute7
288 ,p_attribute8
289 => p_rec.attribute8
290 ,p_attribute9
291 => p_rec.attribute9
292 ,p_attribute10
293 => p_rec.attribute10
294 ,p_attribute11
295 => p_rec.attribute11
296 ,p_attribute12
297 => p_rec.attribute12
298 ,p_attribute13
299 => p_rec.attribute13
300 ,p_attribute14
301 => p_rec.attribute14
302 ,p_attribute15
303 => p_rec.attribute15
304 ,p_attribute16
305 => p_rec.attribute16
306 ,p_attribute17
307 => p_rec.attribute17
308 ,p_attribute18
309 => p_rec.attribute18
310 ,p_attribute19
311 => p_rec.attribute19
312 ,p_attribute20
313 => p_rec.attribute20
314 ,p_attribute21
315 => p_rec.attribute21
316 ,p_attribute22
317 => p_rec.attribute22
318 ,p_attribute23
319 => p_rec.attribute23
320 ,p_attribute24
321 => p_rec.attribute24
322 ,p_attribute25
323 => p_rec.attribute25
324 ,p_attribute26
325 => p_rec.attribute26
326 ,p_attribute27
327 => p_rec.attribute27
328 ,p_attribute28
329 => p_rec.attribute28
330 ,p_attribute29
331 => p_rec.attribute29
332 ,p_attribute30
333 => p_rec.attribute30
334 ,p_information_category
335 => p_rec.information_category
336 ,p_tp_cost_information1
337 => p_rec.tp_cost_information1
338 ,p_tp_cost_information2
339 => p_rec.tp_cost_information2
340 ,p_tp_cost_information3
341 => p_rec.tp_cost_information3
342 ,p_tp_cost_information4
343 => p_rec.tp_cost_information4
344 ,p_tp_cost_information5
345 => p_rec.tp_cost_information5
346 ,p_tp_cost_information6
347 => p_rec.tp_cost_information6
348 ,p_tp_cost_information7
349 => p_rec.tp_cost_information7
350 ,p_tp_cost_information8
351 => p_rec.tp_cost_information8
352 ,p_tp_cost_information9
353 => p_rec.tp_cost_information9
354 ,p_tp_cost_information10
355 => p_rec.tp_cost_information10
356 ,p_tp_cost_information11
357 => p_rec.tp_cost_information11
358 ,p_tp_cost_information12
359 => p_rec.tp_cost_information12
360 ,p_tp_cost_information13
361 => p_rec.tp_cost_information13
362 ,p_tp_cost_information14
363 => p_rec.tp_cost_information14
364 ,p_tp_cost_information15
365 => p_rec.tp_cost_information15
366 ,p_tp_cost_information16
367 => p_rec.tp_cost_information16
368 ,p_tp_cost_information17
369 => p_rec.tp_cost_information17
370 ,p_tp_cost_information18
371 => p_rec.tp_cost_information18
372 ,p_tp_cost_information19
373 => p_rec.tp_cost_information19
374 ,p_tp_cost_information20
375 => p_rec.tp_cost_information20
376 ,p_tp_cost_information21
377 => p_rec.tp_cost_information21
378 ,p_tp_cost_information22
379 => p_rec.tp_cost_information22
380 ,p_tp_cost_information23
381 => p_rec.tp_cost_information23
382 ,p_tp_cost_information24
383 => p_rec.tp_cost_information24
384 ,p_tp_cost_information25
385 => p_rec.tp_cost_information25
386 ,p_tp_cost_information26
387 => p_rec.tp_cost_information26
388 ,p_tp_cost_information27
389 => p_rec.tp_cost_information27
390 ,p_tp_cost_information28
391 => p_rec.tp_cost_information28
392 ,p_tp_cost_information29
393 => p_rec.tp_cost_information29
394 ,p_tp_cost_information30
395 => p_rec.tp_cost_information30
396 ,p_tp_measurement_type_id_o
397 => ota_tpc_shd.g_old_rec.tp_measurement_type_id
398 ,p_training_plan_id_o
399 => ota_tpc_shd.g_old_rec.training_plan_id
400 ,p_booking_id_o
401 => ota_tpc_shd.g_old_rec.booking_id
402 ,p_event_id_o
403 => ota_tpc_shd.g_old_rec.event_id
404 ,p_amount_o
405 => ota_tpc_shd.g_old_rec.amount
406 ,p_currency_code_o
407 => ota_tpc_shd.g_old_rec.currency_code
408 ,p_business_group_id_o
409 => ota_tpc_shd.g_old_rec.business_group_id
410 ,p_object_version_number_o
411 => ota_tpc_shd.g_old_rec.object_version_number
412 ,p_attribute_category_o
413 => ota_tpc_shd.g_old_rec.attribute_category
414 ,p_attribute1_o
415 => ota_tpc_shd.g_old_rec.attribute1
416 ,p_attribute2_o
417 => ota_tpc_shd.g_old_rec.attribute2
418 ,p_attribute3_o
419 => ota_tpc_shd.g_old_rec.attribute3
420 ,p_attribute4_o
421 => ota_tpc_shd.g_old_rec.attribute4
422 ,p_attribute5_o
423 => ota_tpc_shd.g_old_rec.attribute5
424 ,p_attribute6_o
425 => ota_tpc_shd.g_old_rec.attribute6
426 ,p_attribute7_o
427 => ota_tpc_shd.g_old_rec.attribute7
428 ,p_attribute8_o
429 => ota_tpc_shd.g_old_rec.attribute8
430 ,p_attribute9_o
431 => ota_tpc_shd.g_old_rec.attribute9
432 ,p_attribute10_o
433 => ota_tpc_shd.g_old_rec.attribute10
434 ,p_attribute11_o
435 => ota_tpc_shd.g_old_rec.attribute11
436 ,p_attribute12_o
437 => ota_tpc_shd.g_old_rec.attribute12
438 ,p_attribute13_o
439 => ota_tpc_shd.g_old_rec.attribute13
440 ,p_attribute14_o
441 => ota_tpc_shd.g_old_rec.attribute14
442 ,p_attribute15_o
443 => ota_tpc_shd.g_old_rec.attribute15
444 ,p_attribute16_o
445 => ota_tpc_shd.g_old_rec.attribute16
446 ,p_attribute17_o
447 => ota_tpc_shd.g_old_rec.attribute17
448 ,p_attribute18_o
449 => ota_tpc_shd.g_old_rec.attribute18
450 ,p_attribute19_o
451 => ota_tpc_shd.g_old_rec.attribute19
452 ,p_attribute20_o
453 => ota_tpc_shd.g_old_rec.attribute20
454 ,p_attribute21_o
455 => ota_tpc_shd.g_old_rec.attribute21
456 ,p_attribute22_o
457 => ota_tpc_shd.g_old_rec.attribute22
458 ,p_attribute23_o
459 => ota_tpc_shd.g_old_rec.attribute23
460 ,p_attribute24_o
461 => ota_tpc_shd.g_old_rec.attribute24
462 ,p_attribute25_o
463 => ota_tpc_shd.g_old_rec.attribute25
464 ,p_attribute26_o
465 => ota_tpc_shd.g_old_rec.attribute26
466 ,p_attribute27_o
467 => ota_tpc_shd.g_old_rec.attribute27
468 ,p_attribute28_o
469 => ota_tpc_shd.g_old_rec.attribute28
470 ,p_attribute29_o
471 => ota_tpc_shd.g_old_rec.attribute29
472 ,p_attribute30_o
473 => ota_tpc_shd.g_old_rec.attribute30
474 ,p_information_category_o
475 => ota_tpc_shd.g_old_rec.information_category
476 ,p_tp_cost_information1_o
477 => ota_tpc_shd.g_old_rec.tp_cost_information1
478 ,p_tp_cost_information2_o
479 => ota_tpc_shd.g_old_rec.tp_cost_information2
480 ,p_tp_cost_information3_o
481 => ota_tpc_shd.g_old_rec.tp_cost_information3
482 ,p_tp_cost_information4_o
483 => ota_tpc_shd.g_old_rec.tp_cost_information4
484 ,p_tp_cost_information5_o
485 => ota_tpc_shd.g_old_rec.tp_cost_information5
486 ,p_tp_cost_information6_o
487 => ota_tpc_shd.g_old_rec.tp_cost_information6
488 ,p_tp_cost_information7_o
489 => ota_tpc_shd.g_old_rec.tp_cost_information7
490 ,p_tp_cost_information8_o
491 => ota_tpc_shd.g_old_rec.tp_cost_information8
492 ,p_tp_cost_information9_o
493 => ota_tpc_shd.g_old_rec.tp_cost_information9
494 ,p_tp_cost_information10_o
495 => ota_tpc_shd.g_old_rec.tp_cost_information10
496 ,p_tp_cost_information11_o
497 => ota_tpc_shd.g_old_rec.tp_cost_information11
498 ,p_tp_cost_information12_o
499 => ota_tpc_shd.g_old_rec.tp_cost_information12
500 ,p_tp_cost_information13_o
501 => ota_tpc_shd.g_old_rec.tp_cost_information13
502 ,p_tp_cost_information14_o
503 => ota_tpc_shd.g_old_rec.tp_cost_information14
504 ,p_tp_cost_information15_o
505 => ota_tpc_shd.g_old_rec.tp_cost_information15
506 ,p_tp_cost_information16_o
507 => ota_tpc_shd.g_old_rec.tp_cost_information16
508 ,p_tp_cost_information17_o
509 => ota_tpc_shd.g_old_rec.tp_cost_information17
510 ,p_tp_cost_information18_o
511 => ota_tpc_shd.g_old_rec.tp_cost_information18
512 ,p_tp_cost_information19_o
513 => ota_tpc_shd.g_old_rec.tp_cost_information19
514 ,p_tp_cost_information20_o
515 => ota_tpc_shd.g_old_rec.tp_cost_information20
516 ,p_tp_cost_information21_o
517 => ota_tpc_shd.g_old_rec.tp_cost_information21
518 ,p_tp_cost_information22_o
519 => ota_tpc_shd.g_old_rec.tp_cost_information22
520 ,p_tp_cost_information23_o
521 => ota_tpc_shd.g_old_rec.tp_cost_information23
522 ,p_tp_cost_information24_o
523 => ota_tpc_shd.g_old_rec.tp_cost_information24
524 ,p_tp_cost_information25_o
525 => ota_tpc_shd.g_old_rec.tp_cost_information25
526 ,p_tp_cost_information26_o
527 => ota_tpc_shd.g_old_rec.tp_cost_information26
528 ,p_tp_cost_information27_o
529 => ota_tpc_shd.g_old_rec.tp_cost_information27
530 ,p_tp_cost_information28_o
531 => ota_tpc_shd.g_old_rec.tp_cost_information28
532 ,p_tp_cost_information29_o
533 => ota_tpc_shd.g_old_rec.tp_cost_information29
534 ,p_tp_cost_information30_o
535 => ota_tpc_shd.g_old_rec.tp_cost_information30
536 );
537 --
538 exception
539 --
540 when hr_api.cannot_find_prog_unit then
541 --
542 hr_api.cannot_find_prog_unit_error
543 (p_module_name => 'OTA_TRAINING_PLAN_COSTS'
544 ,p_hook_type => 'AU');
545 --
546 end;
547 --
548 hr_utility.set_location(' Leaving:'||l_proc, 10);
549 End post_update;
550 --
551 -- ----------------------------------------------------------------------------
552 -- |-----------------------------< convert_defs >-----------------------------|
553 -- ----------------------------------------------------------------------------
554 -- {Start Of Comments}
555 --
556 -- Description:
557 -- The Convert_Defs procedure has one very important function:
558 -- It must return the record structure for the row with all system defaulted
559 -- values converted into its corresponding parameter value for update. When
560 -- we attempt to update a row through the Upd process , certain
561 -- parameters can be defaulted which enables flexibility in the calling of
562 -- the upd process (e.g. only attributes which need to be updated need to be
563 -- specified). For the upd process to determine which attributes
564 -- have NOT been specified we need to check if the parameter has a reserved
565 -- system default value. Therefore, for all parameters which have a
566 -- corresponding reserved system default mechanism specified we need to
567 -- check if a system default is being used. If a system default is being
568 -- used then we convert the defaulted value into its corresponding attribute
569 -- value held in the g_old_rec data structure.
570 --
571 -- Prerequisites:
572 -- This private function can only be called from the upd process.
573 --
574 -- In Parameters:
575 -- A Pl/Sql record structure.
576 --
577 -- Post Success:
578 -- The record structure will be returned with all system defaulted parameter
579 -- values converted into its current row attribute value.
580 --
581 -- Post Failure:
582 -- No direct error handling is required within this function. Any possible
583 -- errors within this procedure will be a PL/SQL value error due to
584 -- conversion of datatypes or data lengths.
585 --
586 -- Developer Implementation Notes:
587 -- None.
588 --
589 -- Access Status:
590 -- Internal Row Handler Use Only.
591 --
592 -- {End Of Comments}
593 -- ----------------------------------------------------------------------------
594 Procedure convert_defs
595 (p_rec in out nocopy ota_tpc_shd.g_rec_type
596 ) is
597 --
598 Begin
599 --
600 -- We must now examine each argument value in the
601 -- p_rec plsql record structure
602 -- to see if a system default is being used. If a system default
603 -- is being used then we must set to the 'current' argument value.
604 --
605 If (p_rec.tp_measurement_type_id = hr_api.g_number) then
606 p_rec.tp_measurement_type_id :=
607 ota_tpc_shd.g_old_rec.tp_measurement_type_id;
608 End If;
609 If (p_rec.training_plan_id = hr_api.g_number) then
610 p_rec.training_plan_id :=
611 ota_tpc_shd.g_old_rec.training_plan_id;
612 End If;
613 If (p_rec.booking_id = hr_api.g_number) then
614 p_rec.booking_id :=
615 ota_tpc_shd.g_old_rec.booking_id;
616 End If;
617 If (p_rec.event_id = hr_api.g_number) then
618 p_rec.event_id :=
619 ota_tpc_shd.g_old_rec.event_id;
620 End If;
621 If (p_rec.amount = hr_api.g_number) then
622 p_rec.amount :=
623 ota_tpc_shd.g_old_rec.amount;
624 End If;
625 If (p_rec.currency_code = hr_api.g_varchar2) then
626 p_rec.currency_code :=
627 ota_tpc_shd.g_old_rec.currency_code;
628 End If;
629 If (p_rec.business_group_id = hr_api.g_number) then
630 p_rec.business_group_id :=
631 ota_tpc_shd.g_old_rec.business_group_id;
632 End If;
633 If (p_rec.attribute_category = hr_api.g_varchar2) then
634 p_rec.attribute_category :=
635 ota_tpc_shd.g_old_rec.attribute_category;
636 End If;
637 If (p_rec.attribute1 = hr_api.g_varchar2) then
638 p_rec.attribute1 :=
639 ota_tpc_shd.g_old_rec.attribute1;
640 End If;
641 If (p_rec.attribute2 = hr_api.g_varchar2) then
642 p_rec.attribute2 :=
643 ota_tpc_shd.g_old_rec.attribute2;
644 End If;
645 If (p_rec.attribute3 = hr_api.g_varchar2) then
646 p_rec.attribute3 :=
647 ota_tpc_shd.g_old_rec.attribute3;
648 End If;
649 If (p_rec.attribute4 = hr_api.g_varchar2) then
650 p_rec.attribute4 :=
651 ota_tpc_shd.g_old_rec.attribute4;
652 End If;
653 If (p_rec.attribute5 = hr_api.g_varchar2) then
654 p_rec.attribute5 :=
655 ota_tpc_shd.g_old_rec.attribute5;
656 End If;
657 If (p_rec.attribute6 = hr_api.g_varchar2) then
658 p_rec.attribute6 :=
659 ota_tpc_shd.g_old_rec.attribute6;
660 End If;
661 If (p_rec.attribute7 = hr_api.g_varchar2) then
662 p_rec.attribute7 :=
663 ota_tpc_shd.g_old_rec.attribute7;
664 End If;
665 If (p_rec.attribute8 = hr_api.g_varchar2) then
666 p_rec.attribute8 :=
667 ota_tpc_shd.g_old_rec.attribute8;
668 End If;
669 If (p_rec.attribute9 = hr_api.g_varchar2) then
670 p_rec.attribute9 :=
671 ota_tpc_shd.g_old_rec.attribute9;
672 End If;
673 If (p_rec.attribute10 = hr_api.g_varchar2) then
674 p_rec.attribute10 :=
675 ota_tpc_shd.g_old_rec.attribute10;
676 End If;
677 If (p_rec.attribute11 = hr_api.g_varchar2) then
678 p_rec.attribute11 :=
679 ota_tpc_shd.g_old_rec.attribute11;
680 End If;
681 If (p_rec.attribute12 = hr_api.g_varchar2) then
682 p_rec.attribute12 :=
683 ota_tpc_shd.g_old_rec.attribute12;
684 End If;
685 If (p_rec.attribute13 = hr_api.g_varchar2) then
686 p_rec.attribute13 :=
687 ota_tpc_shd.g_old_rec.attribute13;
688 End If;
689 If (p_rec.attribute14 = hr_api.g_varchar2) then
690 p_rec.attribute14 :=
691 ota_tpc_shd.g_old_rec.attribute14;
692 End If;
693 If (p_rec.attribute15 = hr_api.g_varchar2) then
694 p_rec.attribute15 :=
695 ota_tpc_shd.g_old_rec.attribute15;
696 End If;
697 If (p_rec.attribute16 = hr_api.g_varchar2) then
698 p_rec.attribute16 :=
699 ota_tpc_shd.g_old_rec.attribute16;
700 End If;
701 If (p_rec.attribute17 = hr_api.g_varchar2) then
702 p_rec.attribute17 :=
703 ota_tpc_shd.g_old_rec.attribute17;
704 End If;
705 If (p_rec.attribute18 = hr_api.g_varchar2) then
706 p_rec.attribute18 :=
707 ota_tpc_shd.g_old_rec.attribute18;
708 End If;
709 If (p_rec.attribute19 = hr_api.g_varchar2) then
710 p_rec.attribute19 :=
711 ota_tpc_shd.g_old_rec.attribute19;
712 End If;
713 If (p_rec.attribute20 = hr_api.g_varchar2) then
714 p_rec.attribute20 :=
715 ota_tpc_shd.g_old_rec.attribute20;
716 End If;
717 If (p_rec.attribute21 = hr_api.g_varchar2) then
718 p_rec.attribute21 :=
719 ota_tpc_shd.g_old_rec.attribute21;
720 End If;
721 If (p_rec.attribute22 = hr_api.g_varchar2) then
722 p_rec.attribute22 :=
723 ota_tpc_shd.g_old_rec.attribute22;
724 End If;
725 If (p_rec.attribute23 = hr_api.g_varchar2) then
726 p_rec.attribute23 :=
727 ota_tpc_shd.g_old_rec.attribute23;
728 End If;
729 If (p_rec.attribute24 = hr_api.g_varchar2) then
730 p_rec.attribute24 :=
731 ota_tpc_shd.g_old_rec.attribute24;
732 End If;
733 If (p_rec.attribute25 = hr_api.g_varchar2) then
734 p_rec.attribute25 :=
735 ota_tpc_shd.g_old_rec.attribute25;
736 End If;
737 If (p_rec.attribute26 = hr_api.g_varchar2) then
738 p_rec.attribute26 :=
739 ota_tpc_shd.g_old_rec.attribute26;
740 End If;
741 If (p_rec.attribute27 = hr_api.g_varchar2) then
742 p_rec.attribute27 :=
743 ota_tpc_shd.g_old_rec.attribute27;
744 End If;
745 If (p_rec.attribute28 = hr_api.g_varchar2) then
746 p_rec.attribute28 :=
747 ota_tpc_shd.g_old_rec.attribute28;
748 End If;
749 If (p_rec.attribute29 = hr_api.g_varchar2) then
750 p_rec.attribute29 :=
751 ota_tpc_shd.g_old_rec.attribute29;
752 End If;
753 If (p_rec.attribute30 = hr_api.g_varchar2) then
754 p_rec.attribute30 :=
755 ota_tpc_shd.g_old_rec.attribute30;
756 End If;
757 If (p_rec.information_category = hr_api.g_varchar2) then
758 p_rec.information_category :=
759 ota_tpc_shd.g_old_rec.information_category;
760 End If;
761 If (p_rec.tp_cost_information1 = hr_api.g_varchar2) then
762 p_rec.tp_cost_information1 :=
763 ota_tpc_shd.g_old_rec.tp_cost_information1;
764 End If;
765 If (p_rec.tp_cost_information2 = hr_api.g_varchar2) then
766 p_rec.tp_cost_information2 :=
767 ota_tpc_shd.g_old_rec.tp_cost_information2;
768 End If;
769 If (p_rec.tp_cost_information3 = hr_api.g_varchar2) then
770 p_rec.tp_cost_information3 :=
771 ota_tpc_shd.g_old_rec.tp_cost_information3;
772 End If;
773 If (p_rec.tp_cost_information4 = hr_api.g_varchar2) then
774 p_rec.tp_cost_information4 :=
775 ota_tpc_shd.g_old_rec.tp_cost_information4;
776 End If;
777 If (p_rec.tp_cost_information5 = hr_api.g_varchar2) then
778 p_rec.tp_cost_information5 :=
779 ota_tpc_shd.g_old_rec.tp_cost_information5;
780 End If;
781 If (p_rec.tp_cost_information6 = hr_api.g_varchar2) then
782 p_rec.tp_cost_information6 :=
783 ota_tpc_shd.g_old_rec.tp_cost_information6;
784 End If;
785 If (p_rec.tp_cost_information7 = hr_api.g_varchar2) then
786 p_rec.tp_cost_information7 :=
787 ota_tpc_shd.g_old_rec.tp_cost_information7;
788 End If;
789 If (p_rec.tp_cost_information8 = hr_api.g_varchar2) then
790 p_rec.tp_cost_information8 :=
791 ota_tpc_shd.g_old_rec.tp_cost_information8;
792 End If;
793 If (p_rec.tp_cost_information9 = hr_api.g_varchar2) then
794 p_rec.tp_cost_information9 :=
795 ota_tpc_shd.g_old_rec.tp_cost_information9;
796 End If;
797 If (p_rec.tp_cost_information10 = hr_api.g_varchar2) then
798 p_rec.tp_cost_information10 :=
799 ota_tpc_shd.g_old_rec.tp_cost_information10;
800 End If;
801 If (p_rec.tp_cost_information11 = hr_api.g_varchar2) then
802 p_rec.tp_cost_information11 :=
803 ota_tpc_shd.g_old_rec.tp_cost_information11;
804 End If;
805 If (p_rec.tp_cost_information12 = hr_api.g_varchar2) then
806 p_rec.tp_cost_information12 :=
807 ota_tpc_shd.g_old_rec.tp_cost_information12;
808 End If;
809 If (p_rec.tp_cost_information13 = hr_api.g_varchar2) then
810 p_rec.tp_cost_information13 :=
811 ota_tpc_shd.g_old_rec.tp_cost_information13;
812 End If;
813 If (p_rec.tp_cost_information14 = hr_api.g_varchar2) then
814 p_rec.tp_cost_information14 :=
815 ota_tpc_shd.g_old_rec.tp_cost_information14;
816 End If;
817 If (p_rec.tp_cost_information15 = hr_api.g_varchar2) then
818 p_rec.tp_cost_information15 :=
819 ota_tpc_shd.g_old_rec.tp_cost_information15;
820 End If;
821 If (p_rec.tp_cost_information16 = hr_api.g_varchar2) then
822 p_rec.tp_cost_information16 :=
823 ota_tpc_shd.g_old_rec.tp_cost_information16;
824 End If;
825 If (p_rec.tp_cost_information17 = hr_api.g_varchar2) then
826 p_rec.tp_cost_information17 :=
827 ota_tpc_shd.g_old_rec.tp_cost_information17;
828 End If;
829 If (p_rec.tp_cost_information18 = hr_api.g_varchar2) then
830 p_rec.tp_cost_information18 :=
831 ota_tpc_shd.g_old_rec.tp_cost_information18;
832 End If;
833 If (p_rec.tp_cost_information19 = hr_api.g_varchar2) then
834 p_rec.tp_cost_information19 :=
835 ota_tpc_shd.g_old_rec.tp_cost_information19;
836 End If;
837 If (p_rec.tp_cost_information20 = hr_api.g_varchar2) then
838 p_rec.tp_cost_information20 :=
839 ota_tpc_shd.g_old_rec.tp_cost_information20;
840 End If;
841 If (p_rec.tp_cost_information21 = hr_api.g_varchar2) then
842 p_rec.tp_cost_information21 :=
843 ota_tpc_shd.g_old_rec.tp_cost_information21;
844 End If;
845 If (p_rec.tp_cost_information22 = hr_api.g_varchar2) then
846 p_rec.tp_cost_information22 :=
847 ota_tpc_shd.g_old_rec.tp_cost_information22;
848 End If;
849 If (p_rec.tp_cost_information23 = hr_api.g_varchar2) then
850 p_rec.tp_cost_information23 :=
851 ota_tpc_shd.g_old_rec.tp_cost_information23;
852 End If;
853 If (p_rec.tp_cost_information24 = hr_api.g_varchar2) then
854 p_rec.tp_cost_information24 :=
855 ota_tpc_shd.g_old_rec.tp_cost_information24;
856 End If;
857 If (p_rec.tp_cost_information25 = hr_api.g_varchar2) then
858 p_rec.tp_cost_information25 :=
859 ota_tpc_shd.g_old_rec.tp_cost_information25;
860 End If;
861 If (p_rec.tp_cost_information26 = hr_api.g_varchar2) then
862 p_rec.tp_cost_information26 :=
863 ota_tpc_shd.g_old_rec.tp_cost_information26;
864 End If;
865 If (p_rec.tp_cost_information27 = hr_api.g_varchar2) then
866 p_rec.tp_cost_information27 :=
867 ota_tpc_shd.g_old_rec.tp_cost_information27;
868 End If;
869 If (p_rec.tp_cost_information28 = hr_api.g_varchar2) then
870 p_rec.tp_cost_information28 :=
871 ota_tpc_shd.g_old_rec.tp_cost_information28;
872 End If;
873 If (p_rec.tp_cost_information29 = hr_api.g_varchar2) then
874 p_rec.tp_cost_information29 :=
875 ota_tpc_shd.g_old_rec.tp_cost_information29;
876 End If;
877 If (p_rec.tp_cost_information30 = hr_api.g_varchar2) then
878 p_rec.tp_cost_information30 :=
879 ota_tpc_shd.g_old_rec.tp_cost_information30;
880 End If;
881 --
882 End convert_defs;
883 --
884 -- ----------------------------------------------------------------------------
885 -- |---------------------------------< upd >----------------------------------|
886 -- ----------------------------------------------------------------------------
887 Procedure upd
888 (p_effective_date in date
889 ,p_rec in out nocopy ota_tpc_shd.g_rec_type
890 ) is
891 --
892 l_proc varchar2(72) := g_package||'upd';
893 --
894 Begin
895 hr_utility.set_location('Entering:'||l_proc, 5);
896 --
897 -- We must lock the row which we need to update.
898 --
899 ota_tpc_shd.lck
900 (p_rec.training_plan_cost_id
901 ,p_rec.object_version_number
902 );
903 --
904 -- 1. During an update system defaults are used to determine if
905 -- arguments have been defaulted or not. We must therefore
906 -- derive the full record structure values to be updated.
907 --
908 -- 2. Call the supporting update validate operations.
909 --
910 convert_defs(p_rec);
911 ota_tpc_bus.update_validate
912 (p_effective_date
913 ,p_rec
914 );
915 --
916 -- Call the supporting pre-update operation
917 --
918 ota_tpc_upd.pre_update(p_rec);
919 --
920 -- Update the row.
921 --
922 ota_tpc_upd.update_dml(p_rec);
923 --
924 -- Call the supporting post-update operation
925 --
926 ota_tpc_upd.post_update
927 (p_effective_date
928 ,p_rec
929 );
930 End upd;
931 --
932 -- ----------------------------------------------------------------------------
933 -- |---------------------------------< upd >----------------------------------|
934 -- ----------------------------------------------------------------------------
935 Procedure upd
936 (p_effective_date in date
937 ,p_training_plan_cost_id in number
938 ,p_object_version_number in out nocopy number
939 ,p_amount in number default hr_api.g_number
940 ,p_currency_code in varchar2 default hr_api.g_varchar2
941 ,p_attribute_category in varchar2 default hr_api.g_varchar2
942 ,p_attribute1 in varchar2 default hr_api.g_varchar2
943 ,p_attribute2 in varchar2 default hr_api.g_varchar2
944 ,p_attribute3 in varchar2 default hr_api.g_varchar2
945 ,p_attribute4 in varchar2 default hr_api.g_varchar2
946 ,p_attribute5 in varchar2 default hr_api.g_varchar2
947 ,p_attribute6 in varchar2 default hr_api.g_varchar2
948 ,p_attribute7 in varchar2 default hr_api.g_varchar2
949 ,p_attribute8 in varchar2 default hr_api.g_varchar2
950 ,p_attribute9 in varchar2 default hr_api.g_varchar2
951 ,p_attribute10 in varchar2 default hr_api.g_varchar2
952 ,p_attribute11 in varchar2 default hr_api.g_varchar2
953 ,p_attribute12 in varchar2 default hr_api.g_varchar2
954 ,p_attribute13 in varchar2 default hr_api.g_varchar2
955 ,p_attribute14 in varchar2 default hr_api.g_varchar2
956 ,p_attribute15 in varchar2 default hr_api.g_varchar2
957 ,p_attribute16 in varchar2 default hr_api.g_varchar2
958 ,p_attribute17 in varchar2 default hr_api.g_varchar2
959 ,p_attribute18 in varchar2 default hr_api.g_varchar2
960 ,p_attribute19 in varchar2 default hr_api.g_varchar2
961 ,p_attribute20 in varchar2 default hr_api.g_varchar2
962 ,p_attribute21 in varchar2 default hr_api.g_varchar2
963 ,p_attribute22 in varchar2 default hr_api.g_varchar2
964 ,p_attribute23 in varchar2 default hr_api.g_varchar2
965 ,p_attribute24 in varchar2 default hr_api.g_varchar2
966 ,p_attribute25 in varchar2 default hr_api.g_varchar2
967 ,p_attribute26 in varchar2 default hr_api.g_varchar2
968 ,p_attribute27 in varchar2 default hr_api.g_varchar2
969 ,p_attribute28 in varchar2 default hr_api.g_varchar2
970 ,p_attribute29 in varchar2 default hr_api.g_varchar2
971 ,p_attribute30 in varchar2 default hr_api.g_varchar2
972 ,p_information_category in varchar2 default hr_api.g_varchar2
973 ,p_tp_cost_information1 in varchar2 default hr_api.g_varchar2
974 ,p_tp_cost_information2 in varchar2 default hr_api.g_varchar2
975 ,p_tp_cost_information3 in varchar2 default hr_api.g_varchar2
976 ,p_tp_cost_information4 in varchar2 default hr_api.g_varchar2
977 ,p_tp_cost_information5 in varchar2 default hr_api.g_varchar2
978 ,p_tp_cost_information6 in varchar2 default hr_api.g_varchar2
979 ,p_tp_cost_information7 in varchar2 default hr_api.g_varchar2
980 ,p_tp_cost_information8 in varchar2 default hr_api.g_varchar2
981 ,p_tp_cost_information9 in varchar2 default hr_api.g_varchar2
982 ,p_tp_cost_information10 in varchar2 default hr_api.g_varchar2
983 ,p_tp_cost_information11 in varchar2 default hr_api.g_varchar2
984 ,p_tp_cost_information12 in varchar2 default hr_api.g_varchar2
985 ,p_tp_cost_information13 in varchar2 default hr_api.g_varchar2
986 ,p_tp_cost_information14 in varchar2 default hr_api.g_varchar2
987 ,p_tp_cost_information15 in varchar2 default hr_api.g_varchar2
988 ,p_tp_cost_information16 in varchar2 default hr_api.g_varchar2
989 ,p_tp_cost_information17 in varchar2 default hr_api.g_varchar2
990 ,p_tp_cost_information18 in varchar2 default hr_api.g_varchar2
991 ,p_tp_cost_information19 in varchar2 default hr_api.g_varchar2
992 ,p_tp_cost_information20 in varchar2 default hr_api.g_varchar2
993 ,p_tp_cost_information21 in varchar2 default hr_api.g_varchar2
994 ,p_tp_cost_information22 in varchar2 default hr_api.g_varchar2
995 ,p_tp_cost_information23 in varchar2 default hr_api.g_varchar2
996 ,p_tp_cost_information24 in varchar2 default hr_api.g_varchar2
997 ,p_tp_cost_information25 in varchar2 default hr_api.g_varchar2
998 ,p_tp_cost_information26 in varchar2 default hr_api.g_varchar2
999 ,p_tp_cost_information27 in varchar2 default hr_api.g_varchar2
1000 ,p_tp_cost_information28 in varchar2 default hr_api.g_varchar2
1001 ,p_tp_cost_information29 in varchar2 default hr_api.g_varchar2
1002 ,p_tp_cost_information30 in varchar2 default hr_api.g_varchar2
1003 ) is
1004 --
1005 l_rec ota_tpc_shd.g_rec_type;
1006 l_proc varchar2(72) := g_package||'upd';
1007 --
1008 Begin
1009 hr_utility.set_location('Entering:'||l_proc, 5);
1010 --
1011 -- Call conversion function to turn arguments into the
1012 -- l_rec structure.
1013 --
1014 l_rec :=
1015 ota_tpc_shd.convert_args
1016 (p_training_plan_cost_id
1017 ,hr_api.g_number
1018 ,hr_api.g_number
1019 ,hr_api.g_number
1020 ,hr_api.g_number
1021 ,p_amount
1022 ,p_currency_code
1023 ,hr_api.g_number
1024 ,p_object_version_number
1025 ,p_attribute_category
1026 ,p_attribute1
1027 ,p_attribute2
1028 ,p_attribute3
1029 ,p_attribute4
1030 ,p_attribute5
1031 ,p_attribute6
1032 ,p_attribute7
1033 ,p_attribute8
1034 ,p_attribute9
1035 ,p_attribute10
1036 ,p_attribute11
1037 ,p_attribute12
1038 ,p_attribute13
1039 ,p_attribute14
1040 ,p_attribute15
1041 ,p_attribute16
1042 ,p_attribute17
1043 ,p_attribute18
1044 ,p_attribute19
1045 ,p_attribute20
1046 ,p_attribute21
1047 ,p_attribute22
1048 ,p_attribute23
1049 ,p_attribute24
1050 ,p_attribute25
1051 ,p_attribute26
1052 ,p_attribute27
1053 ,p_attribute28
1054 ,p_attribute29
1055 ,p_attribute30
1056 ,p_information_category
1057 ,p_tp_cost_information1
1058 ,p_tp_cost_information2
1059 ,p_tp_cost_information3
1060 ,p_tp_cost_information4
1061 ,p_tp_cost_information5
1062 ,p_tp_cost_information6
1063 ,p_tp_cost_information7
1064 ,p_tp_cost_information8
1065 ,p_tp_cost_information9
1066 ,p_tp_cost_information10
1067 ,p_tp_cost_information11
1068 ,p_tp_cost_information12
1069 ,p_tp_cost_information13
1070 ,p_tp_cost_information14
1071 ,p_tp_cost_information15
1072 ,p_tp_cost_information16
1073 ,p_tp_cost_information17
1074 ,p_tp_cost_information18
1075 ,p_tp_cost_information19
1076 ,p_tp_cost_information20
1077 ,p_tp_cost_information21
1078 ,p_tp_cost_information22
1079 ,p_tp_cost_information23
1080 ,p_tp_cost_information24
1081 ,p_tp_cost_information25
1082 ,p_tp_cost_information26
1083 ,p_tp_cost_information27
1084 ,p_tp_cost_information28
1085 ,p_tp_cost_information29
1086 ,p_tp_cost_information30
1087 );
1088 --
1089 -- Having converted the arguments into the
1090 -- plsql record structure we call the corresponding record
1091 -- business process.
1092 --
1093 ota_tpc_upd.upd
1094 (p_effective_date
1095 ,l_rec
1096 );
1097 p_object_version_number := l_rec.object_version_number;
1098 --
1099 hr_utility.set_location(' Leaving:'||l_proc, 10);
1100 End upd;
1101 --
1102 end ota_tpc_upd;