1 Package Body ota_nhs_upd as
2 /* $Header: otnhsrhi.pkb 120.1 2005/09/30 05:00:04 ssur noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ota_nhs_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(p_rec in out nocopy ota_nhs_shd.g_rec_type) is
55 --
56 l_proc varchar2(72) := g_package||'update_dml';
57 --
58 Begin
59 hr_utility.set_location('Entering:'||l_proc, 5);
60 --
61 -- Increment the object version
62 --
63 p_rec.object_version_number := p_rec.object_version_number + 1;
64 --
65 ota_nhs_shd.g_api_dml := true; -- Set the api dml status
66 --
67 -- Update the ota_notrng_histories Row
68 --
69 update ota_notrng_histories
70 set
71 nota_history_id = p_rec.nota_history_id,
72 person_id = p_rec.person_id,
73 contact_id = p_rec.contact_id,
74 trng_title = p_rec.trng_title,
75 provider = p_rec.provider,
76 type = p_rec.type,
77 centre = p_rec.centre,
78 completion_date = p_rec.completion_date,
79 award = p_rec.award,
80 rating = p_rec.rating,
81 duration = p_rec.duration,
82 duration_units = p_rec.duration_units,
83 activity_version_id = p_rec.activity_version_id,
84 status = p_rec.status,
85 verified_by_id = p_rec.verified_by_id,
86 nth_information_category = p_rec.nth_information_category,
87 nth_information1 = p_rec.nth_information1,
88 nth_information2 = p_rec.nth_information2,
89 nth_information3 = p_rec.nth_information3,
90 nth_information4 = p_rec.nth_information4,
91 nth_information5 = p_rec.nth_information5,
92 nth_information6 = p_rec.nth_information6,
93 nth_information7 = p_rec.nth_information7,
94 nth_information8 = p_rec.nth_information8,
95 nth_information9 = p_rec.nth_information9,
96 nth_information10 = p_rec.nth_information10,
97 nth_information11 = p_rec.nth_information11,
98 nth_information12 = p_rec.nth_information12,
99 nth_information13 = p_rec.nth_information13,
100 nth_information15 = p_rec.nth_information15,
101 nth_information16 = p_rec.nth_information16,
102 nth_information17 = p_rec.nth_information17,
103 nth_information18 = p_rec.nth_information18,
104 nth_information19 = p_rec.nth_information19,
105 nth_information20 = p_rec.nth_information20,
106 org_id = p_rec.org_id,
107 object_version_number = p_rec.object_version_number,
108 business_group_id = p_rec.business_group_id,
109 nth_information14 = p_rec.nth_information14,
110 customer_id = p_rec.customer_id,
111 organization_id = p_rec.organization_id
112 where nota_history_id = p_rec.nota_history_id;
113 --
114 ota_nhs_shd.g_api_dml := false; -- Unset the api dml status
115 --
116 hr_utility.set_location(' Leaving:'||l_proc, 10);
117 --
118 Exception
119 When hr_api.check_integrity_violated Then
120 -- A check constraint has been violated
121 ota_nhs_shd.g_api_dml := false; -- Unset the api dml status
122 ota_nhs_shd.constraint_error
123 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
124 When hr_api.parent_integrity_violated Then
125 -- Parent integrity has been violated
126 ota_nhs_shd.g_api_dml := false; -- Unset the api dml status
127 ota_nhs_shd.constraint_error
128 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
129 When hr_api.unique_integrity_violated Then
130 -- Unique integrity has been violated
131 ota_nhs_shd.g_api_dml := false; -- Unset the api dml status
132 ota_nhs_shd.constraint_error
133 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
134 When Others Then
135 ota_nhs_shd.g_api_dml := false; -- Unset the api dml status
136 Raise;
137 End update_dml;
138 --
139 -- ----------------------------------------------------------------------------
140 -- |------------------------------< pre_update >------------------------------|
141 -- ----------------------------------------------------------------------------
142 -- {Start Of Comments}
143 --
144 -- Description:
145 -- This private procedure contains any processing which is required before
146 -- the update dml.
147 --
148 -- Prerequisites:
149 -- This is an internal procedure which is called from the upd procedure.
150 --
151 -- In Parameters:
152 -- A Pl/Sql record structre.
153 --
154 -- Post Success:
155 -- Processing continues.
156 --
157 -- Post Failure:
158 -- If an error has occurred, an error message and exception will be raised
159 -- but not handled.
160 --
161 -- Developer Implementation Notes:
162 -- Any pre-processing required before the update dml is issued should be
163 -- coded within this procedure. It is important to note that any 3rd party
164 -- maintenance should be reviewed before placing in this procedure.
165 --
166 -- Access Status:
167 -- Internal Row Handler Use Only.
168 --
169 -- {End Of Comments}
170 -- ----------------------------------------------------------------------------
171 Procedure pre_update(p_rec in ota_nhs_shd.g_rec_type) is
172 --
173 l_proc varchar2(72) := g_package||'pre_update';
174 --
175 Begin
176 hr_utility.set_location('Entering:'||l_proc, 5);
177 --
178 hr_utility.set_location(' Leaving:'||l_proc, 10);
179 End pre_update;
180 --
181 -- ----------------------------------------------------------------------------
182 -- |-----------------------------< post_update >------------------------------|
183 -- ----------------------------------------------------------------------------
184 -- {Start Of Comments}
185 --
186 -- Description:
187 -- This private procedure contains any processing which is required after the
188 -- update dml.
189 --
190 -- Prerequisites:
191 -- This is an internal procedure which is called from the upd procedure.
192 --
193 -- In Parameters:
194 -- A Pl/Sql record structre.
195 --
196 -- Post Success:
197 -- Processing continues.
198 --
199 -- Post Failure:
200 -- If an error has occurred, an error message and exception will be raised
201 -- but not handled.
202 --
203 -- Developer Implementation Notes:
204 -- Any post-processing required after the update dml is issued should be
205 -- coded within this procedure. It is important to note that any 3rd party
206 -- maintenance should be reviewed before placing in this procedure.
207 --
208 -- Access Status:
209 -- Internal Row Handler Use Only.
210 --
211 -- {End Of Comments}
212 -- ----------------------------------------------------------------------------
213 Procedure post_update(p_effective_date in date,
214 p_rec in ota_nhs_shd.g_rec_type) is
215 --
216 l_proc varchar2(72) := g_package||'post_update';
217 --
218 Begin
219 hr_utility.set_location('Entering:'||l_proc, 5);
220 --
221 begin
222 --
223 ota_nhs_rku.after_update
224 (p_effective_date => p_effective_date
225 ,p_nota_history_id
226 => p_rec.nota_history_id
227 ,p_person_id
228 => p_rec.person_id
229 ,p_contact_id
230 => p_rec.contact_id
231 ,p_trng_title
232 => p_rec.trng_title
233 ,p_provider
234 => p_rec.provider
235 ,p_type
236 => p_rec.type
237 ,p_centre
238 => p_rec.centre
239 ,p_completion_date
240 => p_rec.completion_date
241 ,p_award
242 => p_rec.award
243 ,p_rating
244 => p_rec.rating
245 ,p_duration
246 => p_rec.duration
247 ,p_duration_units
248 => p_rec.duration_units
249 ,p_activity_version_id
250 => p_rec.activity_version_id
251 ,p_status
252 => p_rec.status
253 ,p_verified_by_id
254 => p_rec.verified_by_id
255 ,p_nth_information_category
256 => p_rec.nth_information_category
257 ,p_nth_information1
258 => p_rec.nth_information1
259 ,p_nth_information2
260 => p_rec.nth_information2
261 ,p_nth_information3
262 => p_rec.nth_information3
263 ,p_nth_information4
264 => p_rec.nth_information4
265 ,p_nth_information5
266 => p_rec.nth_information5
267 ,p_nth_information6
268 => p_rec.nth_information6
269 ,p_nth_information7
270 => p_rec.nth_information7
271 ,p_nth_information8
272 => p_rec.nth_information8
273 ,p_nth_information9
274 => p_rec.nth_information9
275 ,p_nth_information10
276 => p_rec.nth_information10
277 ,p_nth_information11
278 => p_rec.nth_information11
279 ,p_nth_information12
280 => p_rec.nth_information12
281 ,p_nth_information13
282 => p_rec.nth_information13
283 ,p_nth_information15
284 => p_rec.nth_information15
285 ,p_nth_information16
286 => p_rec.nth_information16
287 ,p_nth_information17
288 => p_rec.nth_information17
289 ,p_nth_information18
290 => p_rec.nth_information18
291 ,p_nth_information19
292 => p_rec.nth_information19
293 ,p_nth_information20
294 => p_rec.nth_information20
295 ,p_org_id
296 => p_rec.org_id
297 ,p_object_version_number
298 => p_rec.object_version_number
299 ,p_business_group_id
300 => p_rec.business_group_id
301 ,p_nth_information14
302 => p_rec.nth_information14
303 ,p_customer_id
304 => p_rec.customer_id
305 ,p_organization_id
306 => p_rec.organization_id
307 ,p_person_id_o
308 => ota_nhs_shd.g_old_rec.person_id
309 ,p_contact_id_o
310 => ota_nhs_shd.g_old_rec.contact_id
311 ,p_trng_title_o
312 => ota_nhs_shd.g_old_rec.trng_title
313 ,p_provider_o
314 => ota_nhs_shd.g_old_rec.provider
315 ,p_type_o
316 => ota_nhs_shd.g_old_rec.type
317 ,p_centre_o
318 => ota_nhs_shd.g_old_rec.centre
319 ,p_completion_date_o
320 => ota_nhs_shd.g_old_rec.completion_date
321 ,p_award_o
322 => ota_nhs_shd.g_old_rec.award
323 ,p_rating_o
324 => ota_nhs_shd.g_old_rec.rating
325 ,p_duration_o
326 => ota_nhs_shd.g_old_rec.duration
327 ,p_duration_units_o
328 => ota_nhs_shd.g_old_rec.duration_units
329 ,p_activity_version_id_o
330 => ota_nhs_shd.g_old_rec.activity_version_id
331 ,p_status_o
332 => ota_nhs_shd.g_old_rec.status
333 ,p_verified_by_id_o
334 => ota_nhs_shd.g_old_rec.verified_by_id
335 ,p_nth_information_category_o
336 => ota_nhs_shd.g_old_rec.nth_information_category
337 ,p_nth_information1_o
338 => ota_nhs_shd.g_old_rec.nth_information1
339 ,p_nth_information2_o
340 => ota_nhs_shd.g_old_rec.nth_information2
341 ,p_nth_information3_o
342 => ota_nhs_shd.g_old_rec.nth_information3
343 ,p_nth_information4_o
344 => ota_nhs_shd.g_old_rec.nth_information4
345 ,p_nth_information5_o
346 => ota_nhs_shd.g_old_rec.nth_information5
347 ,p_nth_information6_o
348 => ota_nhs_shd.g_old_rec.nth_information6
349 ,p_nth_information7_o
350 => ota_nhs_shd.g_old_rec.nth_information7
351 ,p_nth_information8_o
352 => ota_nhs_shd.g_old_rec.nth_information8
353 ,p_nth_information9_o
354 => ota_nhs_shd.g_old_rec.nth_information9
355 ,p_nth_information10_o
356 => ota_nhs_shd.g_old_rec.nth_information10
357 ,p_nth_information11_o
358 => ota_nhs_shd.g_old_rec.nth_information11
359 ,p_nth_information12_o
360 => ota_nhs_shd.g_old_rec.nth_information12
361 ,p_nth_information13_o
362 => ota_nhs_shd.g_old_rec.nth_information13
363 ,p_nth_information15_o
364 => ota_nhs_shd.g_old_rec.nth_information15
365 ,p_nth_information16_o
366 => ota_nhs_shd.g_old_rec.nth_information16
367 ,p_nth_information17_o
368 => ota_nhs_shd.g_old_rec.nth_information17
369 ,p_nth_information18_o
370 => ota_nhs_shd.g_old_rec.nth_information18
371 ,p_nth_information19_o
372 => ota_nhs_shd.g_old_rec.nth_information19
373 ,p_nth_information20_o
374 => ota_nhs_shd.g_old_rec.nth_information20
375 ,p_org_id_o
376 => ota_nhs_shd.g_old_rec.org_id
377 ,p_object_version_number_o
378 => ota_nhs_shd.g_old_rec.object_version_number
379 ,p_business_group_id_o
380 => ota_nhs_shd.g_old_rec.business_group_id
381 ,p_nth_information14_o
382 => ota_nhs_shd.g_old_rec.nth_information14
383 ,p_customer_id_o
384 => ota_nhs_shd.g_old_rec.customer_id
385 ,p_organization_id_o
386 => ota_nhs_shd.g_old_rec.organization_id
387 );
388 --
389 exception
390 --
391 when hr_api.cannot_find_prog_unit then
392 --
393 hr_api.cannot_find_prog_unit_error
394 (p_module_name => 'OTA_NOTRNG_HISTORIES'
395 ,p_hook_type => 'AU');
396 --
397 end;
398
399
400
401 hr_utility.set_location(' Leaving:'||l_proc, 10);
402 End post_update;
403 --
404 -- ----------------------------------------------------------------------------
405 -- |-----------------------------< convert_defs >-----------------------------|
406 -- ----------------------------------------------------------------------------
407 -- {Start Of Comments}
408 --
409 -- Description:
410 -- The Convert_Defs procedure has one very important function:
411 -- It must return the record structure for the row with all system defaulted
412 -- values converted into its corresponding parameter value for update. When
413 -- we attempt to update a row through the Upd process , certain
414 -- parameters can be defaulted which enables flexibility in the calling of
415 -- the upd process (e.g. only attributes which need to be updated need to be
416 -- specified). For the upd process to determine which attributes
417 -- have NOT been specified we need to check if the parameter has a reserved
418 -- system default value. Therefore, for all parameters which have a
419 -- corresponding reserved system default mechanism specified we need to
420 -- check if a system default is being used. If a system default is being
421 -- used then we convert the defaulted value into its corresponding attribute
422 -- value held in the g_old_rec data structure.
423 --
424 -- Prerequisites:
425 -- This private function can only be called from the upd process.
426 --
427 -- In Parameters:
428 -- A Pl/Sql record structre.
429 --
430 -- Post Success:
431 -- The record structure will be returned with all system defaulted parameter
432 -- values converted into its current row attribute value.
433 --
434 -- Post Failure:
435 -- No direct error handling is required within this function. Any possible
436 -- errors within this procedure will be a PL/SQL value error due to conversion
437
438
439
440 -- of datatypes or data lengths.
441 --
442 -- Developer Implementation Notes:
443 -- None.
444 --
445 -- Access Status:
446 -- Internal Row Handler Use Only.
447 --
448 -- {End Of Comments}
449 -- ----------------------------------------------------------------------------
450 Procedure convert_defs(p_rec in out nocopy ota_nhs_shd.g_rec_type) is
451 --
452 l_proc varchar2(72) := g_package||'convert_defs';
453 --
454 Begin
455 --
456 hr_utility.set_location('Entering:'||l_proc, 5);
457 --
458 -- We must now examine each argument value in the
459 -- p_rec plsql record structure
460 -- to see if a system default is being used. If a system default
461 -- is being used then we must set to the 'current' argument value.
462 --
463 If (p_rec.person_id = hr_api.g_number) then
464 p_rec.person_id :=
465 ota_nhs_shd.g_old_rec.person_id;
466 End If;
467 If (p_rec.contact_id = hr_api.g_number) then
468 p_rec.contact_id :=
469 ota_nhs_shd.g_old_rec.contact_id;
470 End If;
471 If (p_rec.trng_title = hr_api.g_varchar2) then
472 p_rec.trng_title :=
473 ota_nhs_shd.g_old_rec.trng_title;
474 End If;
475 If (p_rec.provider = hr_api.g_varchar2) then
476 p_rec.provider :=
477 ota_nhs_shd.g_old_rec.provider;
478 End If;
479 If (p_rec.type = hr_api.g_varchar2) then
480 p_rec.type :=
481 ota_nhs_shd.g_old_rec.type;
482 End If;
483 If (p_rec.centre = hr_api.g_varchar2) then
484 p_rec.centre :=
485 ota_nhs_shd.g_old_rec.centre;
486 End If;
487 If (p_rec.completion_date = hr_api.g_date) then
488 p_rec.completion_date :=
489 ota_nhs_shd.g_old_rec.completion_date;
490 End If;
491 If (p_rec.award = hr_api.g_varchar2) then
492 p_rec.award :=
493 ota_nhs_shd.g_old_rec.award;
494 End If;
495 If (p_rec.rating = hr_api.g_varchar2) then
496 p_rec.rating :=
497 ota_nhs_shd.g_old_rec.rating;
498 End If;
499 If (p_rec.duration = hr_api.g_number) then
500 p_rec.duration :=
501 ota_nhs_shd.g_old_rec.duration;
502 End If;
503 If (p_rec.duration_units = hr_api.g_varchar2) then
504 p_rec.duration_units :=
505 ota_nhs_shd.g_old_rec.duration_units;
506 End If;
507 If (p_rec.activity_version_id = hr_api.g_number) then
508 p_rec.activity_version_id :=
509 ota_nhs_shd.g_old_rec.activity_version_id;
510 End If;
511 If (p_rec.status = hr_api.g_varchar2) then
512 p_rec.status :=
513 ota_nhs_shd.g_old_rec.status;
514 End If;
515 If (p_rec.verified_by_id = hr_api.g_number) then
516 p_rec.verified_by_id :=
517 ota_nhs_shd.g_old_rec.verified_by_id;
518 End If;
519 If (p_rec.nth_information_category = hr_api.g_varchar2) then
520 p_rec.nth_information_category :=
521 ota_nhs_shd.g_old_rec.nth_information_category;
522 End If;
523 If (p_rec.nth_information1 = hr_api.g_varchar2) then
524 p_rec.nth_information1 :=
525 ota_nhs_shd.g_old_rec.nth_information1;
526 End If;
527 If (p_rec.nth_information2 = hr_api.g_varchar2) then
528 p_rec.nth_information2 :=
529 ota_nhs_shd.g_old_rec.nth_information2;
530 End If;
531 If (p_rec.nth_information3 = hr_api.g_varchar2) then
532 p_rec.nth_information3 :=
533 ota_nhs_shd.g_old_rec.nth_information3;
534 End If;
535 If (p_rec.nth_information4 = hr_api.g_varchar2) then
536 p_rec.nth_information4 :=
537 ota_nhs_shd.g_old_rec.nth_information4;
538 End If;
539 If (p_rec.nth_information5 = hr_api.g_varchar2) then
540 p_rec.nth_information5 :=
541 ota_nhs_shd.g_old_rec.nth_information5;
542 End If;
543 If (p_rec.nth_information6 = hr_api.g_varchar2) then
544 p_rec.nth_information6 :=
545 ota_nhs_shd.g_old_rec.nth_information6;
546 End If;
547 If (p_rec.nth_information7 = hr_api.g_varchar2) then
548 p_rec.nth_information7 :=
549 ota_nhs_shd.g_old_rec.nth_information7;
550 End If;
551 If (p_rec.nth_information8 = hr_api.g_varchar2) then
552 p_rec.nth_information8 :=
553 ota_nhs_shd.g_old_rec.nth_information8;
554 End If;
555 If (p_rec.nth_information9 = hr_api.g_varchar2) then
556 p_rec.nth_information9 :=
557 ota_nhs_shd.g_old_rec.nth_information9;
558 End If;
559 If (p_rec.nth_information10 = hr_api.g_varchar2) then
560 p_rec.nth_information10 :=
561 ota_nhs_shd.g_old_rec.nth_information10;
562 End If;
563 If (p_rec.nth_information11 = hr_api.g_varchar2) then
564 p_rec.nth_information11 :=
565 ota_nhs_shd.g_old_rec.nth_information11;
566 End If;
567 If (p_rec.nth_information12 = hr_api.g_varchar2) then
568 p_rec.nth_information12 :=
569 ota_nhs_shd.g_old_rec.nth_information12;
570 End If;
571 If (p_rec.nth_information13 = hr_api.g_varchar2) then
572 p_rec.nth_information13 :=
573 ota_nhs_shd.g_old_rec.nth_information13;
574 End If;
575 If (p_rec.nth_information15 = hr_api.g_varchar2) then
576 p_rec.nth_information15 :=
577 ota_nhs_shd.g_old_rec.nth_information15;
578 End If;
579 If (p_rec.nth_information16 = hr_api.g_varchar2) then
580 p_rec.nth_information16 :=
581 ota_nhs_shd.g_old_rec.nth_information16;
582 End If;
583 If (p_rec.nth_information17 = hr_api.g_varchar2) then
584 p_rec.nth_information17 :=
585 ota_nhs_shd.g_old_rec.nth_information17;
586 End If;
587 If (p_rec.nth_information18 = hr_api.g_varchar2) then
588 p_rec.nth_information18 :=
589 ota_nhs_shd.g_old_rec.nth_information18;
590 End If;
591 If (p_rec.nth_information19 = hr_api.g_varchar2) then
592 p_rec.nth_information19 :=
593 ota_nhs_shd.g_old_rec.nth_information19;
594 End If;
595 If (p_rec.nth_information20 = hr_api.g_varchar2) then
596 p_rec.nth_information20 :=
597 ota_nhs_shd.g_old_rec.nth_information20;
598 End If;
599 If (p_rec.org_id = hr_api.g_number) then
600 p_rec.org_id :=
601 ota_nhs_shd.g_old_rec.org_id;
602 End If;
603 If (p_rec.business_group_id = hr_api.g_number) then
604 p_rec.business_group_id :=
605 ota_nhs_shd.g_old_rec.business_group_id;
606 End If;
607 If (p_rec.nth_information14 = hr_api.g_varchar2) then
608 p_rec.nth_information14 :=
609 ota_nhs_shd.g_old_rec.nth_information14;
610 End If;
611 If (p_rec.customer_id = hr_api.g_number) then
612 p_rec.customer_id :=
613 ota_nhs_shd.g_old_rec.customer_id;
614 End If;
615 If (p_rec.organization_id = hr_api.g_number) then
616 p_rec.organization_id :=
617 ota_nhs_shd.g_old_rec.organization_id;
618 End If;
619 --
620 hr_utility.set_location(' Leaving:'||l_proc, 10);
621 --
622 End convert_defs;
623 --
624 -- ----------------------------------------------------------------------------
625 -- |---------------------------------< upd >----------------------------------|
626 -- ----------------------------------------------------------------------------
627 Procedure upd
628 (p_effective_date in date ,
629 p_rec in out nocopy ota_nhs_shd.g_rec_type
630 ) is
631 --
632 l_proc varchar2(72) := g_package||'upd';
633 --
634 Begin
635 hr_utility.set_location('Entering:'||l_proc, 5);
636 --
637 -- We must lock the row which we need to update.
638 --
639 ota_nhs_shd.lck
640 (
641 p_rec.nota_history_id,
642 p_rec.object_version_number
643 );
644 --
645 -- 1. During an update system defaults are used to determine if
646 -- arguments have been defaulted or not. We must therefore
647 -- derive the full record structure values to be updated.
648 --
649 -- 2. Call the supporting update validate operations.
650 --
651 convert_defs(p_rec);
652
653 ota_nhs_bus.update_validate(p_effective_date ,
654 p_rec);
655 --
656 -- Call the supporting pre-update operation
657 --
658 pre_update(p_rec);
659 --
660 -- Update the row.
661 --
662
663 update_dml(p_rec);
664 --
665 -- Call the supporting post-update operation
666 --
667
668 post_update(p_effective_date ,
669 p_rec);
670 End upd;
671 --
672 -- ----------------------------------------------------------------------------
673 -- |---------------------------------< upd >----------------------------------|
674 -- ----------------------------------------------------------------------------
675 Procedure upd
676 (p_effective_date in date ,
677 p_nota_history_id in number,
678 p_person_id in number default hr_api.g_number,
679 p_contact_id in number default hr_api.g_number,
680 p_trng_title in varchar2 default hr_api.g_varchar2,
681 p_provider in varchar2 default hr_api.g_varchar2,
682 p_type in varchar2 default hr_api.g_varchar2,
683 p_centre in varchar2 default hr_api.g_varchar2,
684 p_completion_date in date default hr_api.g_date,
685 p_award in varchar2 default hr_api.g_varchar2,
686 p_rating in varchar2 default hr_api.g_varchar2,
687 p_duration in number default hr_api.g_number,
688 p_duration_units in varchar2 default hr_api.g_varchar2,
689 p_activity_version_id in number default hr_api.g_number,
690 p_status in varchar2 default hr_api.g_varchar2,
691 p_verified_by_id in number default hr_api.g_number,
692 p_nth_information_category in varchar2 default hr_api.g_varchar2,
693 p_nth_information1 in varchar2 default hr_api.g_varchar2,
694 p_nth_information2 in varchar2 default hr_api.g_varchar2,
695 p_nth_information3 in varchar2 default hr_api.g_varchar2,
696 p_nth_information4 in varchar2 default hr_api.g_varchar2,
697 p_nth_information5 in varchar2 default hr_api.g_varchar2,
698 p_nth_information6 in varchar2 default hr_api.g_varchar2,
699 p_nth_information7 in varchar2 default hr_api.g_varchar2,
700 p_nth_information8 in varchar2 default hr_api.g_varchar2,
701 p_nth_information9 in varchar2 default hr_api.g_varchar2,
702 p_nth_information10 in varchar2 default hr_api.g_varchar2,
703 p_nth_information11 in varchar2 default hr_api.g_varchar2,
704 p_nth_information12 in varchar2 default hr_api.g_varchar2,
705 p_nth_information13 in varchar2 default hr_api.g_varchar2,
706 p_nth_information15 in varchar2 default hr_api.g_varchar2,
707 p_nth_information16 in varchar2 default hr_api.g_varchar2,
708 p_nth_information17 in varchar2 default hr_api.g_varchar2,
709 p_nth_information18 in varchar2 default hr_api.g_varchar2,
710 p_nth_information19 in varchar2 default hr_api.g_varchar2,
711 p_nth_information20 in varchar2 default hr_api.g_varchar2,
712 p_org_id in number default hr_api.g_number,
713 p_object_version_number in out nocopy number,
714 p_business_group_id in number default hr_api.g_number,
715 p_nth_information14 in varchar2 default hr_api.g_varchar2,
716 p_customer_id in number default hr_api.g_number,
717 p_organization_id in number default hr_api.g_number
718 ) is
719 --
720 l_rec ota_nhs_shd.g_rec_type;
721 l_proc varchar2(72) := g_package||'upd';
722 --
723 Begin
724 hr_utility.set_location('Entering:'||l_proc, 5);
725
726 --
727 -- Call conversion function to turn arguments into the
728 -- l_rec structure.
729 --
730 l_rec :=
731 ota_nhs_shd.convert_args
732 (
733 p_nota_history_id,
734 p_person_id,
735 p_contact_id,
736 p_trng_title,
737 p_provider,
738 p_type,
739 p_centre,
740 p_completion_date,
741 p_award,
742 p_rating,
743 p_duration,
744 p_duration_units,
745 p_activity_version_id,
746 p_status,
747 p_verified_by_id,
748 p_nth_information_category,
749 p_nth_information1,
750 p_nth_information2,
751 p_nth_information3,
752 p_nth_information4,
753 p_nth_information5,
754 p_nth_information6,
755 p_nth_information7,
756 p_nth_information8,
757 p_nth_information9,
758 p_nth_information10,
759 p_nth_information11,
760 p_nth_information12,
761 p_nth_information13,
762 p_nth_information15,
763 p_nth_information16,
764 p_nth_information17,
765 p_nth_information18,
766 p_nth_information19,
767 p_nth_information20,
768 p_org_id,
769 p_object_version_number,
770 p_business_group_id,
771 p_nth_information14,
772 p_customer_id,
773 p_organization_id
774 );
775 --
776 -- Having converted the arguments into the
777 -- plsql record structure we call the corresponding record
778 -- business process.
779 --
780 upd(p_effective_date ,
781 l_rec);
782 p_object_version_number := l_rec.object_version_number;
783 --
784 hr_utility.set_location(' Leaving:'||l_proc, 10);
785 End upd;
786 --
787 end ota_nhs_upd;