DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_DE_ENT_MINUTES_API

Source


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