DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_DE_OPERATION_GROUPS_API

Source


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