DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_DE_INS_END_REASONS_SWI

Source


1 Package Body pqh_de_ins_end_reasons_swi As
2 /* $Header: pqpreswi.pkb 115.2 2002/12/03 20:42:14 rpasapul noship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'pqh_de_ins_end_reasons_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |----------------------< delete_pension_end_reasons >----------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE delete_pension_end_reasons
12   (p_validate                     in     number    default hr_api.g_false_num
13   ,p_ins_end_reason_id            in     number
14   ,p_object_version_number        in     number
15   ,p_return_status                   out nocopy varchar2
16   ) is
17   --
18   -- Variables for API Boolean parameters
19   l_validate                      boolean;
20   --
21   -- Variables for IN/OUT parameters
22   --
23   -- Other variables
24   l_proc    varchar2(72) := g_package ||'delete_pension_end_reasons';
25 Begin
26 
27 
28 
29   hr_utility.set_location(' Entering:' || l_proc,10);
30   --
31   -- Issue a savepoint
32   --
33   savepoint delete_pension_end_reasons_swi;
34   --
35   -- Initialise Multiple Message Detection
36   --
37   hr_multi_message.enable_message_list;
38   --
39   -- Remember IN OUT parameter IN values
40   --
41   --
42   -- Convert constant values to their corresponding boolean value
43   --
44   l_validate :=
45     hr_api.constant_to_boolean
46       (p_constant_value => p_validate);
47   --
48   -- Register Surrogate ID or user key values
49   --
50   --
51   -- Call API
52   --
53   pqh_de_ins_end_reasons_api.delete_pension_end_reasons
54     (p_validate                     => l_validate
55     ,p_ins_end_reason_id            => p_ins_end_reason_id
56     ,p_object_version_number        => p_object_version_number
57     );
58   --
59   -- Convert API warning boolean parameter values to specific
60   -- messages and add them to Multiple Message List
61   --
62   --
63   -- Convert API non-warning boolean parameter values
64   --
65   --
66   -- Derive the API return status value based on whether
67   -- messages of any type exist in the Multiple Message List.
68   -- Also disable Multiple Message Detection.
69   --
70   p_return_status := hr_multi_message.get_return_status_disable;
71   hr_utility.set_location(' Leaving:' || l_proc,20);
72   --
73 exception
74   when hr_multi_message.error_message_exist then
75     --
76     -- Catch the Multiple Message List exception which
77     -- indicates API processing has been aborted because
78     -- at least one message exists in the list.
79     --
80     rollback to delete_pension_end_reasons_swi;
81     --
82     -- Reset IN OUT parameters and set OUT parameters
83     --
84     p_return_status := hr_multi_message.get_return_status_disable;
85     hr_utility.set_location(' Leaving:' || l_proc, 30);
86   when others then
87     --
88     -- When Multiple Message Detection is enabled catch
89     -- any Application specific or other unexpected
90     -- exceptions.  Adding appropriate details to the
91     -- Multiple Message List.  Otherwise re-raise the
92     -- error.
93     --
94     rollback to delete_pension_end_reasons_swi;
95     if hr_multi_message.unexpected_error_add(l_proc) then
96        hr_utility.set_location(' Leaving:' || l_proc,40);
97        raise;
98     end if;
99     --
100     -- Reset IN OUT and set OUT parameters
101     --
102     p_return_status := hr_multi_message.get_return_status_disable;
103     hr_utility.set_location(' Leaving:' || l_proc,50);
104 end delete_pension_end_reasons;
105 -- ----------------------------------------------------------------------------
106 -- |----------------------< insert_pension_end_reasons >----------------------|
107 -- ----------------------------------------------------------------------------
108 PROCEDURE insert_pension_end_reasons
109   (p_validate                     in     number    default hr_api.g_false_num
110   ,p_effective_date               in     date
111   ,p_business_group_id            in     number
112   ,p_provider_organization_id     in     number
113   ,p_end_reason_number            in     varchar2
114   ,p_end_reason_short_name        in     varchar2
115   ,p_end_reason_description       in     varchar2
116   ,p_ins_end_reason_id               out nocopy number
117   ,p_object_version_number           out nocopy number
118   ,p_return_status                   out nocopy varchar2
119   ) is
120   --
121   -- Variables for API Boolean parameters
122   l_validate                      boolean;
123   --
124   -- Variables for IN/OUT parameters
125   --
126   -- Other variables
127   l_proc    varchar2(72) := g_package ||'insert_pension_end_reasons';
128 Begin
129   hr_utility.set_location(' Entering:' || l_proc,10);
130   --
131   -- Issue a savepoint
132   --
133   savepoint insert_pension_end_reasons_swi;
134   --
135   -- Initialise Multiple Message Detection
136   --
137   hr_multi_message.enable_message_list;
138   --
139   -- Remember IN OUT parameter IN values
140   --
141   --
142   -- Convert constant values to their corresponding boolean value
143   --
144   l_validate :=
145     hr_api.constant_to_boolean
146       (p_constant_value => p_validate);
147   --
148   -- Register Surrogate ID or user key values
149   --
150   pqh_pre_ins.set_base_key_value
151     (p_ins_end_reason_id => p_ins_end_reason_id
152     );
153   --
154   -- Call API
155   --
156   pqh_de_ins_end_reasons_api.insert_pension_end_reasons
157     (p_validate                     => l_validate
158     ,p_effective_date               => p_effective_date
159     ,p_business_group_id            => p_business_group_id
160     ,p_provider_organization_id     => p_provider_organization_id
161     ,p_end_reason_number            => p_end_reason_number
162     ,p_end_reason_short_name        => p_end_reason_short_name
163     ,p_end_reason_description       => p_end_reason_description
164     ,p_ins_end_reason_id            => p_ins_end_reason_id
165     ,p_object_version_number        => p_object_version_number
166     );
167   --
168   -- Convert API warning boolean parameter values to specific
169   -- messages and add them to Multiple Message List
170   --
171   --
172   -- Convert API non-warning boolean parameter values
173   --
174   --
175   -- Derive the API return status value based on whether
176   -- messages of any type exist in the Multiple Message List.
177   -- Also disable Multiple Message Detection.
178   --
179   p_return_status := hr_multi_message.get_return_status_disable;
180   hr_utility.set_location(' Leaving:' || l_proc,20);
181   --
182 exception
183   when hr_multi_message.error_message_exist then
184     --
185     -- Catch the Multiple Message List exception which
186     -- indicates API processing has been aborted because
187     -- at least one message exists in the list.
188     --
189     rollback to insert_pension_end_reasons_swi;
190     --
191     -- Reset IN OUT parameters and set OUT parameters
192     --
193     p_ins_end_reason_id            := null;
194     p_object_version_number        := null;
195     p_return_status := hr_multi_message.get_return_status_disable;
196     hr_utility.set_location(' Leaving:' || l_proc, 30);
197   when others then
198     --
199     -- When Multiple Message Detection is enabled catch
200     -- any Application specific or other unexpected
201     -- exceptions.  Adding appropriate details to the
202     -- Multiple Message List.  Otherwise re-raise the
203     -- error.
204     --
205     rollback to insert_pension_end_reasons_swi;
206     if hr_multi_message.unexpected_error_add(l_proc) then
207        hr_utility.set_location(' Leaving:' || l_proc,40);
208        raise;
209     end if;
210     --
211     -- Reset IN OUT and set OUT parameters
212     --
213     p_ins_end_reason_id            := null;
214     p_object_version_number        := null;
215     p_return_status := hr_multi_message.get_return_status_disable;
216     hr_utility.set_location(' Leaving:' || l_proc,50);
217 end insert_pension_end_reasons;
218 -- ----------------------------------------------------------------------------
219 -- |----------------------< update_pension_end_reasons >----------------------|
220 -- ----------------------------------------------------------------------------
221 PROCEDURE update_pension_end_reasons
222   (p_validate                     in     number    default hr_api.g_false_num
223   ,p_effective_date               in     date
224   ,p_ins_end_reason_id            in     number
225   ,p_object_version_number        in out nocopy number
226   ,p_business_group_id            in     number    default hr_api.g_number
227   ,p_provider_organization_id     in     number    default hr_api.g_number
228   ,p_end_reason_number            in     varchar2  default hr_api.g_varchar2
229   ,p_end_reason_short_name        in     varchar2  default hr_api.g_varchar2
230   ,p_end_reason_description       in     varchar2  default hr_api.g_varchar2
231   ,p_return_status                   out nocopy varchar2
232   ) is
233   --
234   -- Variables for API Boolean parameters
235   l_validate                      boolean;
236   --
237   -- Variables for IN/OUT parameters
238   l_object_version_number         number;
239   --
240   -- Other variables
241   l_proc    varchar2(72) := g_package ||'update_pension_end_reasons';
242 Begin
243   hr_utility.set_location(' Entering:' || l_proc,10);
244   --
245   -- Issue a savepoint
246   --
247   savepoint update_pension_end_reasons_swi;
248   --
249   -- Initialise Multiple Message Detection
250   --
251   hr_multi_message.enable_message_list;
252   --
253   -- Remember IN OUT parameter IN values
254   --
255   l_object_version_number         := p_object_version_number;
256   --
257   -- Convert constant values to their corresponding boolean value
258   --
259   l_validate :=
260     hr_api.constant_to_boolean
261       (p_constant_value => p_validate);
262   --
263   -- Register Surrogate ID or user key values
264   --
265   --
266   -- Call API
267   --
268   pqh_de_ins_end_reasons_api.update_pension_end_reasons
269     (p_validate                     => l_validate
270     ,p_effective_date               => p_effective_date
271     ,p_ins_end_reason_id            => p_ins_end_reason_id
272     ,p_object_version_number        => p_object_version_number
273     ,p_business_group_id            => p_business_group_id
274     ,p_provider_organization_id     => p_provider_organization_id
275     ,p_end_reason_number            => p_end_reason_number
276     ,p_end_reason_short_name        => p_end_reason_short_name
277     ,p_end_reason_description       => p_end_reason_description
278     );
279   --
280   -- Convert API warning boolean parameter values to specific
281   -- messages and add them to Multiple Message List
282   --
283   --
284   -- Convert API non-warning boolean parameter values
285   --
286   --
287   -- Derive the API return status value based on whether
288   -- messages of any type exist in the Multiple Message List.
289   -- Also disable Multiple Message Detection.
290   --
291   p_return_status := hr_multi_message.get_return_status_disable;
292   hr_utility.set_location(' Leaving:' || l_proc,20);
293   --
294 exception
295   when hr_multi_message.error_message_exist then
296     --
297     -- Catch the Multiple Message List exception which
298     -- indicates API processing has been aborted because
299     -- at least one message exists in the list.
300     --
301     rollback to update_pension_end_reasons_swi;
302     --
303     -- Reset IN OUT parameters and set OUT parameters
304     --
305     p_object_version_number        := l_object_version_number;
306     p_return_status := hr_multi_message.get_return_status_disable;
307     hr_utility.set_location(' Leaving:' || l_proc, 30);
308   when others then
309     --
310     -- When Multiple Message Detection is enabled catch
311     -- any Application specific or other unexpected
312     -- exceptions.  Adding appropriate details to the
313     -- Multiple Message List.  Otherwise re-raise the
314     -- error.
315     --
316     rollback to update_pension_end_reasons_swi;
317     if hr_multi_message.unexpected_error_add(l_proc) then
318        hr_utility.set_location(' Leaving:' || l_proc,40);
319        raise;
320     end if;
321     --
322     -- Reset IN OUT and set OUT parameters
323     --
324     p_object_version_number        := l_object_version_number;
325     p_return_status := hr_multi_message.get_return_status_disable;
326     hr_utility.set_location(' Leaving:' || l_proc,50);
327 end update_pension_end_reasons;
328 end pqh_de_ins_end_reasons_swi;