DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_DE_INS_END_REASONS_API

Source


1 Package Body PQH_DE_ins_END_REASONS_API as
2 /* $Header: pqpreapi.pkb 115.1 2002/12/03 20:42:04 rpasapul noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := 'PQH_DE_iNs_END_REASONS_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< Insert_PENSION_END_REASONS >------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure Insert_PENSION_END_REASONS
13  ( p_validate                       in     boolean  default false
14   ,p_effective_date                 in     date
15   ,p_business_group_id              in     number
16   ,p_provider_organization_id       in     number
17   ,p_end_reason_number              in     varchar2
18   ,p_end_reason_short_name          in     varchar2
19   ,p_end_reason_description         in     varchar2
20   ,p_InS_end_reason_id          out nocopy    number
21   ,p_object_version_number          out nocopy    number
22   )  is
23   --
24   -- Declare cursors and local variables
25   --
26 
27   l_proc  varchar2(72)    := g_package||'Insert_PENSION_END_REASONS';
28   l_object_Version_Number PQH_DE_INS_END_REASONS.OBJECT_VERSION_NUMBER%TYPE;
29   L_Effective_Date        Date;
30   l_INS_end_reason_id PQH_DE_INS_END_REASONS.INS_end_reason_id%TYPE;
31 
32 begin
33   hr_utility.set_location('Entering:'|| l_proc, 10);
34   --
35   -- Issue a savepoint
36   --
37   savepoint Insert_PENSION_END_REASONS;
38   --
39   -- Truncate the time portion from all IN date parameters
40   --
41      l_effective_date := Trunc(p_effective_Date);
42   --
43   -- Call Before Process User Hook
44   --
45   begin
46 
47 
48    PQH_DE_ins_END_REASONS_BK1.Insert_PENSION_END_REASONS_b
49    (p_effective_date             => L_Effective_Date
50    ,p_business_group_id          => p_business_group_id
51    ,P_provider_organization_id   => P_provider_organization_id
52    ,p_end_reason_number          => p_end_reason_number
53    , p_end_reason_short_name     => p_end_reason_short_name
54    ,p_end_reason_description     => p_end_reason_description
55 );
56 
57 
58   exception
59     when hr_api.cannot_find_prog_unit then
60       hr_api.cannot_find_prog_unit_error
61         (p_module_name => 'CREATE_PENSION_END_REASONS'
62         ,p_hook_type   => 'BP'
63         );
64   end;
65   --
66   -- Validation in addition to Row Handlers
67   --
68   --
69 
70   -- Process Logic
71      pqh_pre_ins.ins
72     (p_business_group_id          => p_business_group_id
73     ,P_provider_organization_id   => P_provider_organization_id
74     ,p_end_reason_number          => p_end_reason_number
75     , p_end_reason_short_name     => p_end_reason_short_name
76     ,p_end_reason_description     => p_end_reason_description
77     ,p_InS_end_reason_id      => l_INS_end_reason_id
78     ,p_object_version_number      => l_object_version_number
79     );
80 
81   --
82   -- Call After Process User Hook
83   --
84   begin
85 
86 
87         PQH_DE_ins_END_REASONS_BK1.Insert_PENSION_END_REASONS_a
88         (p_effective_date             => L_Effective_Date
89         ,p_business_group_id          => p_business_group_id
90         ,P_provider_organization_id   => P_provider_organization_id
91         ,p_end_reason_number          => p_end_reason_number
92         , p_end_reason_short_name     => p_end_reason_short_name
93         ,p_end_reason_description     => p_end_reason_description
94         ,p_InS_end_reason_id      => p_INS_end_reason_id
95         ,p_object_version_number      => p_object_version_number
96         );
97 
98   exception
99     when hr_api.cannot_find_prog_unit then
100       hr_api.cannot_find_prog_unit_error
101         (p_module_name => 'INSERT_PENSION_END_REASONS'
102         ,p_hook_type   => 'AP'
103         );
104   end;
105   --
106   -- When in validation only mode raise the Validate_Enabled exception
107   --
108   if p_validate then
109     raise hr_api.validate_enabled;
110   end if;
111   --
112   -- Set all output arguments
113   --
114   p_InS_end_reason_id   := l_INS_end_reason_id ;
115   p_object_version_number   := l_object_version_number;
116 
117   --
118   hr_utility.set_location(' Leaving:'||l_proc, 70);
119 exception
120   when hr_api.validate_enabled then
121     --
122     -- As the Validate_Enabled exception has been raised
123     -- we must rollback to the savepoint
124     --
125     rollback to Insert_PENSION_END_REASONS;
126     --
127     -- Only set output warning arguments
128     -- (Any key or derived arguments must be set to null
129     -- when validation only mode is being used.)
130     --
131     p_InS_end_reason_id     := null;
132     p_object_version_number     := null;
133     hr_utility.set_location(' Leaving:'||l_proc, 80);
134 
135   when others then
136     p_InS_end_reason_id     := null;
137     p_object_version_number     := null;
138     --
139     -- A validation or unexpected error has occured
140     --
141     rollback to Insert_PENSION_END_REASONS;
142     hr_utility.set_location(' Leaving:'||l_proc, 90);
143     raise;
144 end Insert_PENSION_END_REASONS;
145 
146 --
147 -- ----------------------------------------------------------------------------
148 -- |--------------------------< Update_PENSION_END_REASONS >------------------|
149 -- ----------------------------------------------------------------------------
150 
151 procedure Update_PENSION_END_REASONS
152  ( p_validate                      in     boolean  default false
153   ,p_effective_date               in     date
154   ,p_InS_end_reason_id        in     number
155   ,p_object_version_number        in out nocopy number
156   ,p_business_group_id            in     number    default hr_api.g_number
157   ,p_provider_organization_id     in     number    default hr_api.g_number
158   ,p_end_reason_number            in     varchar2  default hr_api.g_varchar2
159   ,p_end_reason_short_name        in     varchar2  default hr_api.g_varchar2
160   ,p_end_reason_description       in     varchar2  default hr_api.g_varchar2
161   ) Is
162 
163   l_proc  varchar2(72)      := g_package||'Update_PENSION_END_REASONS';
164   l_object_Version_Number   PQH_DE_INS_END_REASONS.OBJECT_VERSION_NUMBER%TYPE := P_Object_version_Number;
165   L_Effective_Date          Date;
166 
167 Begin
168   hr_utility.set_location('Entering:'|| l_proc, 10);
169   --
170   -- Issue a savepoint
171   --
172   savepoint Update_PENSION_END_REASONS;
173   --
174   -- Truncate the time portion from all IN date parameters
175   --
176      l_effective_date := Trunc(p_effective_Date);
177   --
178   -- Call Before Process User Hook
179   --
180   begin
181 
182 
183 PQH_DE_ins_END_REASONS_BK2.Update_PENSION_END_REASONS_b
184         (p_effective_date             => L_Effective_Date
185         ,p_business_group_id          => p_business_group_id
186         ,P_provider_organization_id   => P_provider_organization_id
187         ,p_end_reason_number          => p_end_reason_number
188         , p_end_reason_short_name     => p_end_reason_short_name
189         ,p_end_reason_description     => p_end_reason_description
190         ,p_InS_end_reason_id      => p_INS_end_reason_id
191         ,p_object_version_number      => p_object_version_number
192         );
193 
194 
195  exception
196     when hr_api.cannot_find_prog_unit then
197       hr_api.cannot_find_prog_unit_error
198         (p_module_name => 'UPDATE_PENSION_END_REASONS'
199         ,p_hook_type   => 'BP'
200         );
201   end;
202 
203 pqh_pre_upd.upd
204         (p_business_group_id          => p_business_group_id
205         ,P_provider_organization_id   => P_provider_organization_id
206         ,p_end_reason_number          => p_end_reason_number
207         , p_end_reason_short_name     => p_end_reason_short_name
208         ,p_end_reason_description     => p_end_reason_description
209         ,p_InS_end_reason_id      => p_INS_end_reason_id
210         ,p_object_version_number      => l_object_version_number
211         );
212 
213 
214 --
215 --
216   -- Call After Process User Hook
217   --
218   begin
219 
220 
221  PQH_DE_ins_END_REASONS_BK2.Update_PENSION_END_REASONS_a
222        (p_effective_date              => L_Effective_Date
223         ,p_business_group_id          => p_business_group_id
224         ,P_provider_organization_id   => P_provider_organization_id
225         ,p_end_reason_number          => p_end_reason_number
226         , p_end_reason_short_name     => p_end_reason_short_name
227         ,p_end_reason_description     => p_end_reason_description
228         ,p_InS_end_reason_id      => p_INS_end_reason_id
229         ,p_object_version_number      => p_object_version_number
230         );
231 
232 
233   exception
234     when hr_api.cannot_find_prog_unit then
235       hr_api.cannot_find_prog_unit_error
236         (p_module_name => 'UPDATE_PENSION_END_REASONS'
237         ,p_hook_type   => 'AP'
238         );
239   end;
240   --
241   -- When in validation only mode raise the Validate_Enabled exception
242   --
243   if p_validate then
244     raise hr_api.validate_enabled;
245   end if;
246   --
247   -- Set all output arguments
248   --
249 
250   p_object_version_number  := l_object_version_number;
251 
252   --
253   hr_utility.set_location(' Leaving:'||l_proc, 70);
254 exception
255   when hr_api.validate_enabled then
256     --
257     -- As the Validate_Enabled exception has been raised
258     -- we must rollback to the savepoint
259     --
260     rollback to Update_PENSION_END_REASONS;
261     --
262     -- Only set output warning arguments
263     -- (Any key or derived arguments must be set to null
264     -- when validation only mode is being used.)
265     --
266     hr_utility.set_location(' Leaving:'||l_proc, 80);
267 
268   when others then
269   p_object_version_number := l_object_version_number;
270     --
271     -- A validation or unexpected error has occured
272     --
273     rollback to Update_PENSION_END_REASONS;
274     hr_utility.set_location(' Leaving:'||l_proc, 90);
275     raise;
276 end Update_PENSION_END_REASONS;
277 
278 --
279 -- ----------------------------------------------------------------------------
280 -- |-------------------< delete_PENSION_END_REASONS>--------------------------
281 -- ----------------------------------------------------------------------------
282 procedure delete_PENSION_END_REASONS
283    (p_validate                      in     boolean  default false
284   ,p_InS_end_reason_id       In     Number
285   ,p_object_version_number         In     number) is
286 
287   -- Declare cursors and local variables
288   --
289   l_proc           varchar2(72) := g_package||'delete_PENSION_END_REASONS';
290   --
291 begin
292   hr_utility.set_location('Entering:'|| l_proc, 10);
293   --
294   -- Issue a savepoint
295   --
296   savepoint delete_PENSION_END_REASONS;
297   --
298   -- Call Before Process User Hook
299   --
300   begin
301   PQH_DE_ins_END_REASONS_BK3.Delete_PENSION_END_REASONS_b
302   (p_InS_end_reason_id             =>   p_INS_END_REASON_Id
303   ,p_object_version_number         =>   p_object_version_number);
304   exception
305     when hr_api.cannot_find_prog_unit then
306       hr_api.cannot_find_prog_unit_error
307         (p_module_name => 'DELETE_PENSION_END_REASONS'
308         ,p_hook_type   => 'BP');
309   end;
310   --
311   -- Process Logic
315   ,p_object_version_number                  =>   p_object_version_number
312   --
313   pqh_pre_del.del
314   (p_InS_end_reason_id                      =>   p_INS_END_REASON_Id
316   );
317   --
318   -- Call After Process User Hook
319   --
320   begin
321 
322   PQH_DE_ins_END_REASONS_BK3.Delete_PENSION_END_REASONS_a
323   (p_InS_end_reason_id         =>   p_iNs_END_REASON_Id
324   ,p_object_version_number         =>   p_object_version_number);
325 
326   exception
327     when hr_api.cannot_find_prog_unit then
328       hr_api.cannot_find_prog_unit_error
329         (p_module_name => 'DELETE_PENSION_END_REASONS'
330         ,p_hook_type   => 'AP');
331   end;
332   --
333   -- When in validation only mode raise the Validate_Enabled exception
334   --
335   if p_validate then
336     raise hr_api.validate_enabled;
337   end if;
338   --
339   -- Set all output arguments
340   --
341   hr_utility.set_location(' Leaving:'||l_proc, 70);
342 exception
343   when hr_api.validate_enabled then
344     --
345     -- As the Validate_Enabled exception has been raised
346     -- we must rollback to the savepoint
347     --
348     rollback to delete_PENSION_END_REASONS;
349     --
350     -- Only set output warning arguments
351     -- (Any key or derived arguments must be set to null
352     -- when validation only mode is being used.)
353     --
354     hr_utility.set_location(' Leaving:'||l_proc, 80);
355   when others then
356     --
357     -- A validation or unexpected error has occured
358     --
359     rollback to delete_PENSION_END_REASONS;
360     hr_utility.set_location(' Leaving:'||l_proc, 90);
361     raise;
362 end delete_PENSION_END_REASONS;
363 
364 end PQH_DE_ins_END_REASONS_API;