DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_DE_LEVEL_NUMBERS_API

Source


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