DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_NHS_API

Source


1 Package Body OTA_NHS_API as
2 /* $Header: otnhsapi.pkb 120.1 2006/01/09 03:20:12 dbatra noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := 'OTA_NHS_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< <create_non_ota_histories> >------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_non_ota_histories
13   (p_validate                      in   boolean    default false
14   ,p_effective_date                in   date
15   ,p_nota_history_id               out nocopy number
16   ,p_person_id                   in    number
17   ,p_contact_id                in   number   default null
18   ,p_trng_title              in  varchar2
19   ,p_provider                      in  varchar2
20   ,p_type                    in  varchar2    default null
21   ,p_centre                     in  varchar2    default null
22   ,p_completion_date            in  date
23   ,p_award                      in  varchar2    default null
24   ,p_rating                     in  varchar2    default null
25   ,p_duration                in  number   default null
26   ,p_duration_units                in  varchar2    default null
27   ,p_activity_version_id           in  number   default null
28   ,p_status                        in  varchar2    default null
29   ,p_verified_by_id                in  number   default null
30   ,p_nth_information_category      in  varchar2    default null
31   ,p_nth_information1              in  varchar2 default null
32   ,p_nth_information2              in  varchar2 default null
33   ,p_nth_information3              in  varchar2 default null
34   ,p_nth_information4              in  varchar2    default null
35   ,p_nth_information5              in  varchar2    default null
36   ,p_nth_information6              in  varchar2    default null
37   ,p_nth_information7              in  varchar2    default null
38   ,p_nth_information8              in  varchar2  default null
39   ,p_nth_information9              in  varchar2  default null
40   ,p_nth_information10             in  varchar2 default null
41   ,p_nth_information11             in  varchar2 default null
42   ,p_nth_information12             in  varchar2 default null
43   ,p_nth_information13             in  varchar2 default null
44   ,p_nth_information15             in  varchar2    default null
45   ,p_nth_information16             in  varchar2 default null
46   ,p_nth_information17             in  varchar2 default null
47   ,p_nth_information18             in  varchar2    default null
48   ,p_nth_information19             in  varchar2 default null
49   ,p_nth_information20             in  varchar2 default null
50   ,p_org_id                        in  number   default null
51   ,p_object_version_number         out nocopy   number
52   ,p_business_group_id             in  number
53   ,p_nth_information14             in  varchar2    default null
54   ,p_customer_id             in  number   default null
55   ,p_organization_id         in  number   default null
56   ,p_some_warning                  out nocopy   boolean
57   ) is
58   --
59   -- Declare cursors and local variables
60   --
61   l_effective_date   date;
62   l_completion_date  date;
63   l_proc                varchar2(72) := g_package||'create_non_ota_histories';
64 begin
65   hr_utility.set_location('Entering:'|| l_proc, 10);
66   --
67   -- Issue a savepoint
68   --
69   savepoint create_histories;
70   --
71   -- Truncate the time portion from all IN date parameters
72   --
73   l_effective_date := trunc(p_effective_date);
74   l_completion_date := trunc(p_completion_date);
75 
76   --
77   -- Call Before Process User Hook
78   --
79  begin
80     OTA_NHS_BK1.create_non_ota_histories_b
81   (p_effective_date          => l_effective_date
82   ,p_nota_history_id    => p_nota_history_id
83   ,p_person_id            => p_person_id
84   ,p_contact_id                 => p_contact_id
85   ,p_trng_title         => p_trng_title
86   ,p_provider                 => p_provider
87   ,p_type               => p_type
88   ,p_centre                => p_centre
89   ,p_completion_date       => l_completion_date
90   ,p_award                 => p_award
91   ,p_rating                => p_rating
92   ,p_duration           => p_duration
93   ,p_duration_units           => p_duration_units
94   ,p_activity_version_id      => p_activity_version_id
95   ,p_status                   => p_status
96   ,p_verified_by_id           => p_verified_by_id
97   ,p_nth_information_category => p_nth_information_category
98   ,p_nth_information1         => p_nth_information1
99   ,p_nth_information2         => p_nth_information2
100   ,p_nth_information3         => p_nth_information3
101   ,p_nth_information4         => p_nth_information4
102   ,p_nth_information5         => p_nth_information5
103   ,p_nth_information6         => p_nth_information6
104   ,p_nth_information7         => p_nth_information7
105   ,p_nth_information8         => p_nth_information8
106   ,p_nth_information9         => p_nth_information9
107   ,p_nth_information10        => p_nth_information10
108   ,p_nth_information11        => p_nth_information11
109   ,p_nth_information12        => p_nth_information12
110   ,p_nth_information13        => p_nth_information13
111   ,p_nth_information15        => p_nth_information15
112   ,p_nth_information16        => p_nth_information16
113   ,p_nth_information17        => p_nth_information17
114   ,p_nth_information18        => p_nth_information18
115   ,p_nth_information19        => p_nth_information19
116   ,p_nth_information20        => p_nth_information20
117   ,p_org_id                   => p_org_id
118   ,p_object_version_number    => p_object_version_number
119   ,p_business_group_id        => p_business_group_id
120   ,p_nth_information14        => p_nth_information14
121   ,p_customer_id        => p_customer_id
122   ,p_organization_id    => p_organization_id
123   );
124 
125   exception
126     when hr_api.cannot_find_prog_unit then
127       hr_api.cannot_find_prog_unit_error
128         (p_module_name => 'create_non_ota_histories_b'
129         ,p_hook_type   => 'BP'
130         );
131   end;
132   --
133   -- Validation in addition to Row Handlers
134   --
135 
136 
137 
138   --
139   -- Process Logic
140   --
141 
142 ota_nhs_ins.ins
143 (p_effective_date         => l_effective_date
144   ,p_nota_history_id    => p_nota_history_id
145   ,p_person_id            => p_person_id
146   ,p_contact_id                 => p_contact_id
147   ,p_trng_title         => p_trng_title
148   ,p_provider                 => p_provider
149   ,p_type               => p_type
150   ,p_centre                => p_centre
151   ,p_completion_date       => l_completion_date
152   ,p_award                 => p_award
153   ,p_rating                => p_rating
154   ,p_duration           => p_duration
155   ,p_duration_units           => p_duration_units
156   ,p_activity_version_id      => p_activity_version_id
157   ,p_status                   => p_status
158   ,p_verified_by_id           => p_verified_by_id
159   ,p_nth_information_category => p_nth_information_category
160   ,p_nth_information1         => p_nth_information1
161   ,p_nth_information2         => p_nth_information2
162   ,p_nth_information3         => p_nth_information3
163   ,p_nth_information4         => p_nth_information4
164   ,p_nth_information5         => p_nth_information5
165   ,p_nth_information6         => p_nth_information6
166   ,p_nth_information7         => p_nth_information7
167   ,p_nth_information8         => p_nth_information8
168   ,p_nth_information9         => p_nth_information9
169   ,p_nth_information10        => p_nth_information10
170   ,p_nth_information11        => p_nth_information11
171   ,p_nth_information12        => p_nth_information12
172   ,p_nth_information13        => p_nth_information13
173   ,p_nth_information15        => p_nth_information15
174   ,p_nth_information16        => p_nth_information16
175   ,p_nth_information17        => p_nth_information17
176   ,p_nth_information18        => p_nth_information18
177   ,p_nth_information19        => p_nth_information19
178   ,p_nth_information20        => p_nth_information20
179   ,p_org_id                   => p_org_id
180   ,p_object_version_number    => p_object_version_number
181   ,p_business_group_id        => p_business_group_id
182   ,p_nth_information14        => p_nth_information14
183   ,p_customer_id        => p_customer_id
184   ,p_organization_id    => p_organization_id
185   );
186 
187   --
188   -- Call After Process User Hook
189   --
190  begin
191     OTA_NHS_BK1.create_non_ota_histories_a
192   (p_effective_date          => l_effective_date
193   ,p_nota_history_id    => p_nota_history_id
194   ,p_person_id            => p_person_id
195   ,p_contact_id                 => p_contact_id
196   ,p_trng_title         => p_trng_title
197   ,p_provider                 => p_provider
198   ,p_type               => p_type
199   ,p_centre                => p_centre
200   ,p_completion_date       => l_completion_date
201   ,p_award                 => p_award
202   ,p_rating                => p_rating
203   ,p_duration           => p_duration
204   ,p_duration_units           => p_duration_units
205   ,p_activity_version_id      => p_activity_version_id
206   ,p_status                   => p_status
207   ,p_verified_by_id           => p_verified_by_id
208   ,p_nth_information_category => p_nth_information_category
209   ,p_nth_information1         => p_nth_information1
210   ,p_nth_information2         => p_nth_information2
211   ,p_nth_information3         => p_nth_information3
212   ,p_nth_information4         => p_nth_information4
213   ,p_nth_information5         => p_nth_information5
214   ,p_nth_information6         => p_nth_information6
215   ,p_nth_information7         => p_nth_information7
216   ,p_nth_information8         => p_nth_information8
217   ,p_nth_information9         => p_nth_information9
218   ,p_nth_information10        => p_nth_information10
219   ,p_nth_information11        => p_nth_information11
220   ,p_nth_information12        => p_nth_information12
221   ,p_nth_information13        => p_nth_information13
222   ,p_nth_information15        => p_nth_information15
223   ,p_nth_information16        => p_nth_information16
224   ,p_nth_information17        => p_nth_information17
225   ,p_nth_information18        => p_nth_information18
226   ,p_nth_information19        => p_nth_information19
227   ,p_nth_information20        => p_nth_information20
228   ,p_org_id                   => p_org_id
229   ,p_object_version_number    => p_object_version_number
230   ,p_business_group_id        => p_business_group_id
231   ,p_nth_information14        => p_nth_information14
232   ,p_customer_id        => p_customer_id
233   ,p_organization_id    => p_organization_id
234   );
235   exception
236     when hr_api.cannot_find_prog_unit then
237       hr_api.cannot_find_prog_unit_error
238         (p_module_name => 'create_non_ota_histories_a'
239         ,p_hook_type   => 'AP'
240         );
241   end;
242   --
243   -- When in validation only mode raise the Validate_Enabled exception
244   --
245   if p_validate then
246     raise hr_api.validate_enabled;
247   end if;
248   --
249   -- Set all output arguments
250   --
251   /*p_id                     := <local_var_set_in_process_logic>
252   p_object_version_number  := <local_var_set_in_process_logic>
253   p_some_warning           := <local_var_set_in_process_logic> */
254   --
255   hr_utility.set_location(' Leaving:'||l_proc, 70);
256 exception
257   when hr_api.validate_enabled then
258     --
259     -- As the Validate_Enabled exception has been raised
260     -- we must rollback to the savepoint
261     --
262     rollback to create_histories;
263     --
264     -- Only set output warning arguments
265     -- (Any key or derived arguments must be set to null
266     -- when validation only mode is being used.)
267     --
268   /*  p_id                     := null;
269     p_object_version_number  := null;
270     p_some_warning           := <local_var_set_in_process_logic>*/
271     hr_utility.set_location(' Leaving:'||l_proc, 80);
272   when others then
273     --
274     -- A validation or unexpected error has occured
275     --
276     rollback to create_histories;
277     hr_utility.set_location(' Leaving:'||l_proc, 90);
278     raise;
279 end create_non_ota_histories;
280 --
281 
282 
283 -- ----------------------------------------------------------------------------
284 -- |--------------------------< <update_non_ota_histories> >-------------------|
285 -- ----------------------------------------------------------------------------
286 --
287 procedure update_non_ota_histories
288   (p_validate                      in   boolean    default false
289   ,p_effective_date                in   date
290   ,p_nota_history_id               in  number
291   ,p_person_id                   in    number
292   ,p_contact_id                in   number   default hr_api.g_number
293   ,p_trng_title              in  varchar2
294   ,p_provider                      in  varchar2
295   ,p_type                    in  varchar2    default hr_api.g_varchar2
296   ,p_centre                     in  varchar2    default hr_api.g_varchar2
297   ,p_completion_date            in  date
298   ,p_award                      in  varchar2    default hr_api.g_varchar2
299   ,p_rating                     in  varchar2    default hr_api.g_varchar2
300   ,p_duration                in  number   default hr_api.g_number
301   ,p_duration_units                in  varchar2    default hr_api.g_varchar2
302   ,p_activity_version_id           in  number   default hr_api.g_number
303   ,p_status                        in  varchar2    default hr_api.g_varchar2
304   ,p_verified_by_id                in  number   default hr_api.g_number
305   ,p_nth_information_category      in  varchar2    default hr_api.g_varchar2
306   ,p_nth_information1              in  varchar2 default hr_api.g_varchar2
307   ,p_nth_information2              in  varchar2 default hr_api.g_varchar2
308   ,p_nth_information3              in  varchar2 default hr_api.g_varchar2
309   ,p_nth_information4              in  varchar2    default hr_api.g_varchar2
310   ,p_nth_information5              in  varchar2    default hr_api.g_varchar2
311   ,p_nth_information6              in  varchar2    default hr_api.g_varchar2
312   ,p_nth_information7              in  varchar2    default hr_api.g_varchar2
313   ,p_nth_information8              in  varchar2    default hr_api.g_varchar2
314   ,p_nth_information9              in  varchar2    default hr_api.g_varchar2
315   ,p_nth_information10             in  varchar2 default hr_api.g_varchar2
316   ,p_nth_information11             in  varchar2 default hr_api.g_varchar2
317   ,p_nth_information12             in  varchar2 default hr_api.g_varchar2
318   ,p_nth_information13             in  varchar2 default hr_api.g_varchar2
319   ,p_nth_information15             in  varchar2    default hr_api.g_varchar2
320   ,p_nth_information16             in  varchar2 default hr_api.g_varchar2
321   ,p_nth_information17             in  varchar2 default hr_api.g_varchar2
322   ,p_nth_information18             in  varchar2    default hr_api.g_varchar2
323   ,p_nth_information19             in  varchar2 default hr_api.g_varchar2
324   ,p_nth_information20             in  varchar2 default hr_api.g_varchar2
325   ,p_org_id                        in  number   default hr_api.g_number
326   ,p_object_version_number         in out nocopy number
327   ,p_business_group_id             in  number
328   ,p_nth_information14             in  varchar2    default hr_api.g_varchar2
329   ,p_customer_id             in  number   default hr_api.g_number
330   ,p_organization_id         in  number   default hr_api.g_number
331   ,p_some_warning                  out nocopy   boolean
332   ) is
333 
334 
335   l_effective_date   date;
336   l_completion_date  date;
337   l_proc                varchar2(72) := g_package||'update_non_ota_histories';
338 begin
339   hr_utility.set_location('Entering:'|| l_proc, 10);
340   --
341   -- Issue a savepoint
342   --
343   savepoint update_histories;
344   --
345   -- Truncate the time portion from all IN date parameters
346   --
350   --
347   l_effective_date := trunc(p_effective_date);
348   l_completion_date := trunc(p_completion_date);
349 
351   -- Call Before Process User Hook
352   --
353   begin
354     OTA_NHS_BK2.update_non_ota_histories_b
355   (p_effective_date     => l_effective_date
356   ,p_nota_history_id    => p_nota_history_id
357   ,p_person_id       => p_person_id
358   ,p_contact_id            => p_contact_id
359   ,p_trng_title         => p_trng_title
360   ,p_provider                 => p_provider
361   ,p_type               => p_type
362   ,p_centre                => p_centre
363   ,p_completion_date       => l_completion_date
364   ,p_award                 => p_award
365   ,p_rating                => p_rating
366   ,p_duration           => p_duration
367   ,p_duration_units           => p_duration_units
368   ,p_activity_version_id      => p_activity_version_id
369   ,p_status                   => p_status
370   ,p_verified_by_id           => p_verified_by_id
371   ,p_nth_information_category => p_nth_information_category
372   ,p_nth_information1         => p_nth_information1
373   ,p_nth_information2         => p_nth_information2
374   ,p_nth_information3         => p_nth_information3
375   ,p_nth_information4         => p_nth_information4
376   ,p_nth_information5         => p_nth_information5
377   ,p_nth_information6         => p_nth_information6
378   ,p_nth_information7         => p_nth_information7
379   ,p_nth_information8         => p_nth_information8
380   ,p_nth_information9         => p_nth_information9
381   ,p_nth_information10        => p_nth_information10
382   ,p_nth_information11        => p_nth_information11
383   ,p_nth_information12        => p_nth_information12
384   ,p_nth_information13        => p_nth_information13
385   ,p_nth_information15        => p_nth_information15
386   ,p_nth_information16        => p_nth_information16
387   ,p_nth_information17        => p_nth_information17
388   ,p_nth_information18        => p_nth_information18
389   ,p_nth_information19        => p_nth_information19
390   ,p_nth_information20        => p_nth_information20
391   ,p_org_id                   => p_org_id
392   ,p_object_version_number    => p_object_version_number
393   ,p_business_group_id        => p_business_group_id
394   ,p_nth_information14        => p_nth_information14
395   ,p_customer_id        => p_customer_id
396   ,p_organization_id    => p_organization_id
397   );
398   exception
399     when hr_api.cannot_find_prog_unit then
400       hr_api.cannot_find_prog_unit_error
401         (p_module_name => 'update_non_ota_histories_b'
402         ,p_hook_type   => 'BP'
403         );
404   end;
405   --
406   -- Validation in addition to Row Handlers
407   --
408 
409 ota_nhs_upd.upd
410 (p_effective_date    => l_effective_date
411   ,p_nota_history_id    => p_nota_history_id
412   ,p_person_id       => p_person_id
413   ,p_contact_id            => p_contact_id
414   ,p_trng_title         => p_trng_title
415   ,p_provider                 => p_provider
416   ,p_type               => p_type
417   ,p_centre                => p_centre
418   ,p_completion_date       => l_completion_date
419   ,p_award                 => p_award
420   ,p_rating                => p_rating
421   ,p_duration           => p_duration
422   ,p_duration_units           => p_duration_units
423   ,p_activity_version_id      => p_activity_version_id
424   ,p_status                   => p_status
425   ,p_verified_by_id           => p_verified_by_id
426   ,p_nth_information_category => p_nth_information_category
427   ,p_nth_information1         => p_nth_information1
428   ,p_nth_information2         => p_nth_information2
429   ,p_nth_information3         => p_nth_information3
430   ,p_nth_information4         => p_nth_information4
431   ,p_nth_information5         => p_nth_information5
432   ,p_nth_information6         => p_nth_information6
433   ,p_nth_information7         => p_nth_information7
434   ,p_nth_information8         => p_nth_information8
435   ,p_nth_information9         => p_nth_information9
436   ,p_nth_information10        => p_nth_information10
437   ,p_nth_information11        => p_nth_information11
438   ,p_nth_information12        => p_nth_information12
439   ,p_nth_information13        => p_nth_information13
440   ,p_nth_information15        => p_nth_information15
441   ,p_nth_information16        => p_nth_information16
442   ,p_nth_information17        => p_nth_information17
443   ,p_nth_information18        => p_nth_information18
444   ,p_nth_information19        => p_nth_information19
445   ,p_nth_information20        => p_nth_information20
446   ,p_org_id                   => p_org_id
447   ,p_object_version_number    => p_object_version_number
448   ,p_business_group_id        => p_business_group_id
449   ,p_nth_information14        => p_nth_information14
450   ,p_customer_id        => p_customer_id
451   ,p_organization_id    => p_organization_id
452   );
453 
454 
455   --
456   -- Process Logic
457   --
458 
459 
460 
461   --
462   -- Call After Process User Hook
463   --
464   begin
465     OTA_NHS_BK2.update_non_ota_histories_b
466   (p_effective_date     => l_effective_date
467   ,p_nota_history_id    => p_nota_history_id
468   ,p_person_id       => p_person_id
469   ,p_contact_id            => p_contact_id
470   ,p_trng_title         => p_trng_title
471   ,p_provider                 => p_provider
472   ,p_type               => p_type
473   ,p_centre                => p_centre
474   ,p_completion_date       => l_completion_date
475   ,p_award                 => p_award
476   ,p_rating                => p_rating
477   ,p_duration           => p_duration
478   ,p_duration_units           => p_duration_units
479   ,p_activity_version_id      => p_activity_version_id
480   ,p_status                   => p_status
481   ,p_verified_by_id           => p_verified_by_id
482   ,p_nth_information_category => p_nth_information_category
483   ,p_nth_information1         => p_nth_information1
484   ,p_nth_information2         => p_nth_information2
485   ,p_nth_information3         => p_nth_information3
486   ,p_nth_information4         => p_nth_information4
487   ,p_nth_information5         => p_nth_information5
488   ,p_nth_information6         => p_nth_information6
489   ,p_nth_information7         => p_nth_information7
490   ,p_nth_information8         => p_nth_information8
491   ,p_nth_information9         => p_nth_information9
492   ,p_nth_information10        => p_nth_information10
493   ,p_nth_information11        => p_nth_information11
494   ,p_nth_information12        => p_nth_information12
495   ,p_nth_information13        => p_nth_information13
496   ,p_nth_information15        => p_nth_information15
497   ,p_nth_information16        => p_nth_information16
498   ,p_nth_information17        => p_nth_information17
499   ,p_nth_information18        => p_nth_information18
500   ,p_nth_information19        => p_nth_information19
501   ,p_nth_information20        => p_nth_information20
502   ,p_org_id                   => p_org_id
503   ,p_object_version_number    => p_object_version_number
504   ,p_business_group_id        => p_business_group_id
505   ,p_nth_information14        => p_nth_information14
506   ,p_customer_id        => p_customer_id
507   ,p_organization_id    => p_organization_id
508   );
509   exception
510     when hr_api.cannot_find_prog_unit then
511       hr_api.cannot_find_prog_unit_error
512         (p_module_name => 'update_non_ota_histories_a'
513         ,p_hook_type   => 'AP'
514         );
515   end;
516   --
517   -- When in validation only mode raise the Validate_Enabled exception
518   --
519   if p_validate then
520     raise hr_api.validate_enabled;
521   end if;
522   --
523   -- Set all output arguments
524   --
525  /* p_id                     := <local_var_set_in_process_logic>
526   p_object_version_number  := <local_var_set_in_process_logic>
527   p_some_warning           := <local_var_set_in_process_logic>*/
528   --
529   hr_utility.set_location(' Leaving:'||l_proc, 70);
530 exception
531   when hr_api.validate_enabled then
532     --
533     -- As the Validate_Enabled exception has been raised
534     -- we must rollback to the savepoint
535     --
536     rollback to update_histories;
537     --
538     -- Only set output warning arguments
539     -- (Any key or derived arguments must be set to null
540     -- when validation only mode is being used.)
541     --
542   /*  p_id                     := null;
543     p_object_version_number  := null;
544     p_some_warning           := <local_var_set_in_process_logic> */
545     hr_utility.set_location(' Leaving:'||l_proc, 80);
546   when others then
547     --
548     -- A validation or unexpected error has occured
549     --
550     rollback to update_histories;
551     hr_utility.set_location(' Leaving:'||l_proc, 90);
552     raise;
553 end update_non_ota_histories;
554 --
555 
556 -- ----------------------------------------------------------------------------
557 -- |--------------------------< <delete_external_learning> >-------------------|
558 -- ----------------------------------------------------------------------------
559 --
560 procedure delete_external_learning
561   (p_validate                      in   boolean    default false
562   ,p_nota_history_id                    in number
563   ,p_object_version_number              in number
564   ) is
565   --
566   -- Declare cursors and local variables
567   --
568   l_proc                    varchar2(72) := g_package||' delete external learning';
569   l_object_version_id       number;
570   --
571   --
572 begin
573   hr_utility.set_location('Entering:'|| l_proc, 10);
574   --
575   -- Issue a savepoint
576   --
577   savepoint delete_external_learning;
578 
579   -- Call Before Process User Hook
580   --
581   begin
582   ota_external_learning_bk3.delete_external_learning_b
583   (p_nota_history_id            => p_nota_history_id
584   ,p_object_version_number       => p_object_version_number
585   );
586   exception
587     when hr_api.cannot_find_prog_unit then
588       hr_api.cannot_find_prog_unit_error
589         (p_module_name => 'delete_external_learning_b'
590         ,p_hook_type   => 'BP'
591         );
592   end;
593   --
594   -- Validation in addition to Row Handlers
595   --
596   --
597   -- Process Logic
598   --
599   ota_nhs_del.del
600   (p_nota_history_id       => p_nota_history_id
601   ,p_object_version_number   => p_object_version_number
602   );
603 
604   --
605   -- Call After Process User Hook
606   --
607   begin
608   ota_external_learning_bk3.delete_external_learning_a
609   (p_nota_history_id            => p_nota_history_id
610   ,p_object_version_number       => p_object_version_number
611   );
612   exception
613     when hr_api.cannot_find_prog_unit then
614       hr_api.cannot_find_prog_unit_error
615         (p_module_name => 'delete_external_learning_a'
616         ,p_hook_type   => 'AP'
617         );
618   end;
619 
620   --
621   -- When in validation only mode raise the Validate_Enabled exception
622   --
623   if p_validate then
624     raise hr_api.validate_enabled;
625   end if;
626   --
627   -- Set all output arguments
628   --
629   --
630   hr_utility.set_location(' Leaving:'||l_proc, 170);
631 exception
632   when hr_api.validate_enabled then
633     --
634     -- As the Validate_Enabled exception has been raised
635     -- we must rollback to the savepoint
636     --
637     rollback to delete_external_learning;
638     --
639     -- Only set output warning arguments
640     -- (Any key or derived arguments must be set to null
641     -- when validation only mode is being used.)
642     --
643     hr_utility.set_location(' Leaving:'||l_proc, 180);
644   when others then
645     --
646     -- A validation or unexpected error has occured
647     --
648     rollback to delete_external_learning;
649     hr_utility.set_location(' Leaving:'||l_proc, 190);
650     raise;
651 
652 end delete_external_learning;
653 end OTA_NHS_API;
654