DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_COPY_ENTITY_PREFS_API

Source


1 Package Body pqh_copy_entity_prefs_api as
2 /* $Header: pqcepapi.pkb 115.3 2002/12/05 19:31:15 rpasapul ship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  pqh_copy_entity_prefs_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_copy_entity_pref >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_copy_entity_pref
13   (p_validate                       in  boolean   default false
14   ,p_copy_entity_pref_id            out nocopy number
15   ,p_table_route_id                 in  number    default null
16   ,p_copy_entity_txn_id             in  number    default null
17   ,p_select_flag                    in  varchar2  default null
18   ,p_object_version_number          out nocopy number
19   ,p_effective_date                 in  date
20   ) is
21   --
22   -- Declare cursors and local variables
23   --
24   l_copy_entity_pref_id pqh_copy_entity_prefs.copy_entity_pref_id%TYPE;
25   l_proc varchar2(72) := g_package||'create_copy_entity_pref';
26   l_object_version_number pqh_copy_entity_prefs.object_version_number%TYPE;
27   --
28 begin
29   --
30   hr_utility.set_location('Entering:'|| l_proc, 10);
31   --
32   -- Issue a savepoint if operating in validation only mode
33   --
34   savepoint create_copy_entity_pref;
35   --
36   hr_utility.set_location(l_proc, 20);
37   --
38   -- Process Logic
39   --
40   begin
41     --
42     -- Start of API User Hook for the before hook of create_copy_entity_prefs
43     --
44     pqh_copy_entity_prefs_bk1.create_copy_entity_pref_b
45       (
46        p_table_route_id                 =>  p_table_route_id
47       ,p_copy_entity_txn_id             =>  p_copy_entity_txn_id
48       ,p_select_flag                    =>  p_select_flag
49       ,p_effective_date               => trunc(p_effective_date)
50       );
51   exception
52     when hr_api.cannot_find_prog_unit then
53       hr_api.cannot_find_prog_unit_error
54         (
55          p_module_name => 'CREATE_COPY_ENTITY_PREF'
56         ,p_hook_type   => 'BP'
57         );
58     --
59     -- End of API User Hook for the before hook of create_copy_entity_prefs
60     --
61   end;
62   --
63   pqh_cep_ins.ins
64     (
65      p_copy_entity_pref_id           => l_copy_entity_pref_id
66     ,p_table_route_id                => p_table_route_id
67     ,p_copy_entity_txn_id            => p_copy_entity_txn_id
68     ,p_select_flag                   => p_select_flag
69     ,p_object_version_number         => l_object_version_number
70     ,p_effective_date                => trunc(p_effective_date)
71     );
72   --
73   begin
74     --
75     -- Start of API User Hook for the after hook of create_copy_entity_prefs
76     --
77     pqh_copy_entity_prefs_bk1.create_copy_entity_pref_a
78       (
79        p_copy_entity_pref_id            =>  l_copy_entity_pref_id
80       ,p_table_route_id                 =>  p_table_route_id
81       ,p_copy_entity_txn_id             =>  p_copy_entity_txn_id
82       ,p_select_flag                    =>  p_select_flag
83       ,p_object_version_number          =>  l_object_version_number
84       ,p_effective_date                 => trunc(p_effective_date)
85       );
86   exception
87     when hr_api.cannot_find_prog_unit then
88       hr_api.cannot_find_prog_unit_error
89         (p_module_name => 'CREATE_COPY_ENTITY_PREF'
90         ,p_hook_type   => 'AP'
91         );
92     --
93     -- End of API User Hook for the after hook of create_copy_entity_prefs
94     --
95   end;
96   --
97   hr_utility.set_location(l_proc, 60);
98   --
99   -- When in validation only mode raise the Validate_Enabled exception
100   --
101   if p_validate then
102     raise hr_api.validate_enabled;
103   end if;
104   --
105   -- Set all output arguments
106   --
107   p_copy_entity_pref_id := l_copy_entity_pref_id;
108   p_object_version_number := l_object_version_number;
109   --
110   hr_utility.set_location(' Leaving:'||l_proc, 70);
111   --
112 exception
113   --
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 create_copy_entity_pref;
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_copy_entity_pref_id := null;
126     p_object_version_number  := null;
127     hr_utility.set_location(' Leaving:'||l_proc, 80);
128     --
129   when others then
130       p_copy_entity_pref_id := null;
131     p_object_version_number  := null;
132     --
133     -- A validation or unexpected error has occured
134     --
135     ROLLBACK TO create_copy_entity_pref;
136     raise;
137     --
138 end create_copy_entity_pref;
139 -- ----------------------------------------------------------------------------
140 -- |------------------------< update_copy_entity_prefs >--- ------------------|
141 -- ----------------------------------------------------------------------------
142 --
143 procedure update_copy_entity_pref
144   (p_validate                       in  boolean   default false
145   ,p_copy_entity_pref_id            in  number
146   ,p_table_route_id                 in  number    default hr_api.g_number
147   ,p_copy_entity_txn_id             in  number    default hr_api.g_number
148   ,p_select_flag                    in  varchar2  default hr_api.g_varchar2
149   ,p_object_version_number          in out nocopy number
150   ,p_effective_date                 in  date
151   ) is
152   --
153   -- Declare cursors and local variables
154   --
155   l_proc varchar2(72) := g_package||'update_copy_entity_pref';
156   l_object_version_number pqh_copy_entity_prefs.object_version_number%TYPE;
157   --
158 begin
159   --
160   hr_utility.set_location('Entering:'|| l_proc, 10);
161   --
162   -- Issue a savepoint if operating in validation only mode
163   --
164   savepoint update_copy_entity_pref;
165   --
166   hr_utility.set_location(l_proc, 20);
167   --
168   -- Process Logic
169   --
170   l_object_version_number := p_object_version_number;
171   --
172   begin
173     --
174     -- Start of API User Hook for the before hook of update_copy_entity_prefs
175     --
176     pqh_copy_entity_prefs_bk2.update_copy_entity_pref_b
177       (
178        p_copy_entity_pref_id            =>  p_copy_entity_pref_id
179       ,p_table_route_id                 =>  p_table_route_id
180       ,p_copy_entity_txn_id             =>  p_copy_entity_txn_id
181       ,p_select_flag                    =>  p_select_flag
182       ,p_object_version_number          =>  p_object_version_number
183     ,p_effective_date                 => trunc(p_effective_date)
184       );
185   exception
186     when hr_api.cannot_find_prog_unit then
187       hr_api.cannot_find_prog_unit_error
188         (p_module_name => 'UPDATE_COPY_ENTITY_PREF'
189         ,p_hook_type   => 'BP'
190         );
191     --
192     -- End of API User Hook for the before hook of update_copy_entity_prefs
193     --
194   end;
195   --
196   pqh_cep_upd.upd
197     (
198      p_copy_entity_pref_id           => p_copy_entity_pref_id
199     ,p_table_route_id                => p_table_route_id
200     ,p_copy_entity_txn_id            => p_copy_entity_txn_id
201     ,p_select_flag                   => p_select_flag
202     ,p_object_version_number         => l_object_version_number
203     ,p_effective_date                => trunc(p_effective_date)
204     );
205   --
206   begin
207     --
208     -- Start of API User Hook for the after hook of update_copy_entity_prefs
209     --
210     pqh_copy_entity_prefs_bk2.update_copy_entity_pref_a
211       (
212        p_copy_entity_pref_id            =>  p_copy_entity_pref_id
213       ,p_table_route_id                 =>  p_table_route_id
214       ,p_copy_entity_txn_id             =>  p_copy_entity_txn_id
215       ,p_select_flag                    =>  p_select_flag
216       ,p_object_version_number          =>  l_object_version_number
217       ,p_effective_date                => trunc(p_effective_date)
218       );
219   exception
220     when hr_api.cannot_find_prog_unit then
221       hr_api.cannot_find_prog_unit_error
222         (p_module_name => 'UPDATE_COPY_ENTITY_PREF'
223         ,p_hook_type   => 'AP'
224         );
225     --
226     -- End of API User Hook for the after hook of update_copy_entity_prefs
227     --
228   end;
229   --
230   hr_utility.set_location(l_proc, 60);
231   --
232   -- When in validation only mode raise the Validate_Enabled exception
233   --
234   if p_validate then
235     raise hr_api.validate_enabled;
236   end if;
237   --
238   -- Set all output arguments
239   --
240   p_object_version_number := l_object_version_number;
241   --
242   hr_utility.set_location(' Leaving:'||l_proc, 70);
243   --
244 exception
245   --
246   when hr_api.validate_enabled then
247     --
248     -- As the Validate_Enabled exception has been raised
249     -- we must rollback to the savepoint
250     --
251     ROLLBACK TO update_copy_entity_pref;
252     --
253     -- Only set output warning arguments
254     -- (Any key or derived arguments must be set to null
255     -- when validation only mode is being used.)
256     --
257     hr_utility.set_location(' Leaving:'||l_proc, 80);
258     --
259   when others then
260     p_object_version_number := l_object_version_number;
261     --
262     -- A validation or unexpected error has occured
263     --
264     ROLLBACK TO update_copy_entity_pref;
265     raise;
266     --
267 end update_copy_entity_pref;
268 -- ----------------------------------------------------------------------------
269 -- |------------------------< delete_copy_entity_pref >----------------------|
270 -- ----------------------------------------------------------------------------
271 --
272 procedure delete_copy_entity_pref
273   (p_validate                       in  boolean  default false
274   ,p_copy_entity_pref_id            in  number
275   ,p_object_version_number          in  number
276   ,p_effective_date                 in  date
277   ) is
278   --
279   -- Declare cursors and local variables
280   --
281   l_proc varchar2(72) := g_package||'delete_copy_entity_pref';
282   l_object_version_number pqh_copy_entity_prefs.object_version_number%TYPE;
283   --
284 begin
285   --
286   hr_utility.set_location('Entering:'|| l_proc, 10);
287   --
288   -- Issue a savepoint if operating in validation only mode
289   --
290   savepoint delete_copy_entity_pref;
291   --
292   hr_utility.set_location(l_proc, 20);
293   --
294   -- Process Logic
295   --
296   l_object_version_number := p_object_version_number;
297   --
298   --
299   begin
300     --
301     -- Start of API User Hook for the before hook of delete_copy_entity_prefs
302     --
303     pqh_copy_entity_prefs_bk3.delete_copy_entity_pref_b
304       (
305        p_copy_entity_pref_id            =>  p_copy_entity_pref_id
306       ,p_object_version_number          =>  p_object_version_number
307     ,p_effective_date                      => trunc(p_effective_date)
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_COPY_ENTITY_PREF'
313         ,p_hook_type   => 'BP'
314         );
315     --
316     -- End of API User Hook for the before hook of delete_copy_entity_prefs
317     --
318   end;
319   --
320   pqh_cep_del.del
321     (
322      p_copy_entity_pref_id           => p_copy_entity_pref_id
323     ,p_object_version_number         => l_object_version_number
324     ,p_effective_date                => p_effective_date
325     );
326   --
327   begin
328     --
329     -- Start of API User Hook for the after hook of delete_copy_entity_prefs
330     --
331     pqh_copy_entity_prefs_bk3.delete_copy_entity_pref_a
332       (
333        p_copy_entity_pref_id            =>  p_copy_entity_pref_id
334       ,p_object_version_number          =>  l_object_version_number
335     ,p_effective_date                      => trunc(p_effective_date)
336       );
337   exception
338     when hr_api.cannot_find_prog_unit then
339       hr_api.cannot_find_prog_unit_error
340         (p_module_name => 'DELETE_COPY_ENTITY_PREF'
341         ,p_hook_type   => 'AP'
342         );
343     --
344     -- End of API User Hook for the after hook of delete_copy_entity_prefs
345     --
346   end;
347   --
348   hr_utility.set_location(l_proc, 60);
349   --
350   -- When in validation only mode raise the Validate_Enabled exception
351   --
352   if p_validate then
353     raise hr_api.validate_enabled;
354   end if;
355   --
356   hr_utility.set_location(' Leaving:'||l_proc, 70);
357   --
358 exception
359   --
360   when hr_api.validate_enabled then
361     --
362     -- As the Validate_Enabled exception has been raised
363     -- we must rollback to the savepoint
364     --
365     ROLLBACK TO delete_copy_entity_pref;
366     --
367     -- Only set output warning arguments
368     -- (Any key or derived arguments must be set to null
369     -- when validation only mode is being used.)
370     --
371     --
372   when others then
373     --
374     -- A validation or unexpected error has occured
375     --
376     ROLLBACK TO delete_copy_entity_pref;
377     raise;
378     --
379 end delete_copy_entity_pref;
380 --
381 -- ----------------------------------------------------------------------------
382 -- |-------------------------------< lck >------------------------------------|
383 -- ----------------------------------------------------------------------------
384 --
385 procedure lck
386   (
387    p_copy_entity_pref_id                   in     number
388   ,p_object_version_number          in     number
389   ) is
390   --
391   --
392   -- Declare cursors and local variables
393   --
394   l_proc varchar2(72) := g_package||'lck';
395   --
396 begin
397   --
398   hr_utility.set_location('Entering:'|| l_proc, 10);
399   --
400   pqh_cep_shd.lck
401     (
402       p_copy_entity_pref_id                 => p_copy_entity_pref_id
403      ,p_object_version_number      => p_object_version_number
404     );
405   --
406   hr_utility.set_location(' Leaving:'||l_proc, 70);
407   --
408 end lck;
409 --
410 end pqh_copy_entity_prefs_api;