DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_SPECIAL_ATTRIBUTES_API

Source


1 Package Body pqh_special_attributes_api as
2 /* $Header: pqsatapi.pkb 115.5 2004/04/09 11:15:18 srajakum ship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  pqh_special_attributes_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_special_attribute >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_special_attribute
13   (p_validate                       in  boolean   default false
14   ,p_special_attribute_id           out nocopy number
15   ,p_txn_category_attribute_id      in  number    default null
16   ,p_attribute_type_cd              in  varchar2  default null
17   ,p_key_attribute_type              in  varchar2  default null
18   ,p_enable_flag              in  varchar2  default null
19   ,p_flex_code                      in  varchar2  default null
20   ,p_object_version_number          out nocopy number
21   ,p_ddf_column_name                in  varchar2  default null
22   ,p_ddf_value_column_name          in  varchar2  default null
23   ,p_context                        in  varchar2  default null
24   ,p_effective_date                 in  date
25   ) is
26   --
27   -- Declare cursors and local variables
28   --
29   l_special_attribute_id pqh_special_attributes.special_attribute_id%TYPE;
30   l_proc varchar2(72) := g_package||'create_special_attribute';
31   l_object_version_number pqh_special_attributes.object_version_number%TYPE;
32   --
33 begin
34   --
35   hr_utility.set_location('Entering:'|| l_proc, 10);
36   --
37   -- Issue a savepoint if operating in validation only mode
38   --
39   savepoint create_special_attribute;
40   --
41   hr_utility.set_location(l_proc, 20);
42   --
43   -- Process Logic
44   --
45   begin
46     --
47     -- Start of API User Hook for the before hook of create_special_attribute
48     --
49     pqh_special_attributes_bk1.create_special_attribute_b
50       (
51        p_txn_category_attribute_id      =>  p_txn_category_attribute_id
52       ,p_attribute_type_cd              =>  p_attribute_type_cd
53       ,p_key_attribute_type             =>  p_key_attribute_type
54       ,p_enable_flag                    =>  p_enable_flag
55       ,p_flex_code                      =>  p_flex_code
56       ,p_ddf_column_name                =>  p_ddf_column_name
57       ,p_ddf_value_column_name          =>  p_ddf_value_column_name
58       ,p_context                        =>  p_context
59       ,p_effective_date               => trunc(p_effective_date)
60       );
61   exception
62     when hr_api.cannot_find_prog_unit then
63       hr_api.cannot_find_prog_unit_error
64         (
65          p_module_name => 'create_special_attribute'
66         ,p_hook_type   => 'BP'
67         );
68     --
69     -- End of API User Hook for the before hook of create_special_attribute
70     --
71   end;
72   --
73   pqh_sat_ins.ins
74     (
75      p_special_attribute_id          => l_special_attribute_id
76     ,p_txn_category_attribute_id     => p_txn_category_attribute_id
77     ,p_attribute_type_cd             => p_attribute_type_cd
78       ,p_key_attribute_type             =>  p_key_attribute_type
79       ,p_enable_flag                    =>  p_enable_flag
80     ,p_flex_code                     => p_flex_code
81     ,p_object_version_number         => l_object_version_number
82     ,p_ddf_column_name               => p_ddf_column_name
83     ,p_ddf_value_column_name         => p_ddf_value_column_name
84     ,p_context                       => p_context
85     ,p_effective_date                => trunc(p_effective_date)
86     );
87   --
88   begin
89     --
90     -- Start of API User Hook for the after hook of create_special_attribute
91     --
92     pqh_special_attributes_bk1.create_special_attribute_a
93       (
94        p_special_attribute_id           =>  l_special_attribute_id
95       ,p_txn_category_attribute_id      =>  p_txn_category_attribute_id
96       ,p_attribute_type_cd              =>  p_attribute_type_cd
97       ,p_key_attribute_type             =>  p_key_attribute_type
98       ,p_enable_flag                    =>  p_enable_flag
99       ,p_flex_code                      =>  p_flex_code
100       ,p_object_version_number          =>  l_object_version_number
101       ,p_ddf_column_name                =>  p_ddf_column_name
102       ,p_ddf_value_column_name          =>  p_ddf_value_column_name
103       ,p_context                        =>  p_context
104       ,p_effective_date                 => trunc(p_effective_date)
105       );
106   exception
107     when hr_api.cannot_find_prog_unit then
108       hr_api.cannot_find_prog_unit_error
109         (p_module_name => 'create_special_attribute'
110         ,p_hook_type   => 'AP'
111         );
112     --
113     -- End of API User Hook for the after hook of create_special_attribute
114     --
115   end;
116   --
117   hr_utility.set_location(l_proc, 60);
118   --
119   -- When in validation only mode raise the Validate_Enabled exception
120   --
121   if p_validate then
122     raise hr_api.validate_enabled;
123   end if;
124   --
125   -- Set all output arguments
126   --
127   p_special_attribute_id := l_special_attribute_id;
128   p_object_version_number := l_object_version_number;
129   --
130   hr_utility.set_location(' Leaving:'||l_proc, 70);
131   --
132 exception
133   --
134   when hr_api.validate_enabled then
135     --
136     -- As the Validate_Enabled exception has been raised
137     -- we must rollback to the savepoint
138     --
139     ROLLBACK TO create_special_attribute;
140     --
141     -- Only set output warning arguments
142     -- (Any key or derived arguments must be set to null
143     -- when validation only mode is being used.)
144     --
145     p_special_attribute_id := null;
146     p_object_version_number  := null;
147     hr_utility.set_location(' Leaving:'||l_proc, 80);
148     --
149   when others then
150        p_special_attribute_id := null;
151     p_object_version_number  := null;
152     --
153     -- A validation or unexpected error has occured
154     --
155     ROLLBACK TO create_special_attribute;
156     raise;
157     --
158 end create_special_attribute;
159 -- ----------------------------------------------------------------------------
160 -- |------------------------< update_special_attribute >--- ------------------|
161 -- ----------------------------------------------------------------------------
162 --
163 procedure update_special_attribute
164   (p_validate                       in  boolean   default false
165   ,p_special_attribute_id           in  number
166   ,p_txn_category_attribute_id      in  number    default hr_api.g_number
167   ,p_attribute_type_cd              in  varchar2  default hr_api.g_varchar2
168   ,p_key_attribute_type              in  varchar2  default hr_api.g_varchar2
169   ,p_enable_flag              in  varchar2  default hr_api.g_varchar2
170   ,p_flex_code                      in  varchar2  default hr_api.g_varchar2
171   ,p_object_version_number          in out nocopy number
172   ,p_ddf_column_name                in  varchar2  default hr_api.g_varchar2
173   ,p_ddf_value_column_name          in  varchar2  default hr_api.g_varchar2
174   ,p_context                        in  varchar2  default hr_api.g_varchar2
175   ,p_effective_date                 in  date
176   ) is
177   --
178   -- Declare cursors and local variables
179   --
180   l_proc varchar2(72) := g_package||'update_special_attribute';
181   l_object_version_number pqh_special_attributes.object_version_number%TYPE;
182   --
183 begin
184   --
185   hr_utility.set_location('Entering:'|| l_proc, 10);
186   --
187   -- Issue a savepoint if operating in validation only mode
188   --
189   savepoint update_special_attribute;
190   --
191   hr_utility.set_location(l_proc, 20);
192   --
193   -- Process Logic
194   --
195   l_object_version_number := p_object_version_number;
196   --
197   begin
198     --
199     -- Start of API User Hook for the before hook of update_special_attribute
200     --
201     pqh_special_attributes_bk2.update_special_attribute_b
202       (
203        p_special_attribute_id           =>  p_special_attribute_id
204       ,p_txn_category_attribute_id      =>  p_txn_category_attribute_id
205       ,p_attribute_type_cd              =>  p_attribute_type_cd
206       ,p_key_attribute_type              =>  p_key_attribute_type
207       ,p_enable_flag              =>  p_enable_flag
208       ,p_flex_code                      =>  p_flex_code
209       ,p_object_version_number          =>  p_object_version_number
210       ,p_ddf_column_name                =>  p_ddf_column_name
211       ,p_ddf_value_column_name          =>  p_ddf_value_column_name
212       ,p_context                        =>  p_context
213     ,p_effective_date                 => trunc(p_effective_date)
214       );
215   exception
216     when hr_api.cannot_find_prog_unit then
217       hr_api.cannot_find_prog_unit_error
218         (p_module_name => 'update_special_attribute'
219         ,p_hook_type   => 'BP'
220         );
221     --
222     -- End of API User Hook for the before hook of update_special_attribute
223     --
224   end;
225   --
226   pqh_sat_upd.upd
227     (
228      p_special_attribute_id          => p_special_attribute_id
229     ,p_txn_category_attribute_id     => p_txn_category_attribute_id
230     ,p_attribute_type_cd             => p_attribute_type_cd
231       ,p_key_attribute_type              =>  p_key_attribute_type
232       ,p_enable_flag              =>  p_enable_flag
233     ,p_flex_code                     => p_flex_code
234     ,p_object_version_number         => l_object_version_number
235     ,p_ddf_column_name               => p_ddf_column_name
236     ,p_ddf_value_column_name         => p_ddf_value_column_name
237     ,p_context                       => p_context
238     ,p_effective_date                => trunc(p_effective_date)
239     );
240   --
241   begin
242     --
243     -- Start of API User Hook for the after hook of update_special_attribute
244     --
245     pqh_special_attributes_bk2.update_special_attribute_a
246       (
247        p_special_attribute_id           =>  p_special_attribute_id
248       ,p_txn_category_attribute_id      =>  p_txn_category_attribute_id
249       ,p_attribute_type_cd              =>  p_attribute_type_cd
250       ,p_key_attribute_type              =>  p_key_attribute_type
251       ,p_enable_flag              =>  p_enable_flag
252       ,p_flex_code                      =>  p_flex_code
253       ,p_object_version_number          =>  l_object_version_number
254       ,p_ddf_column_name                =>  p_ddf_column_name
255       ,p_ddf_value_column_name          =>  p_ddf_value_column_name
256       ,p_context                        =>  p_context
257       ,p_effective_date                => trunc(p_effective_date)
258       );
259   exception
260     when hr_api.cannot_find_prog_unit then
261       hr_api.cannot_find_prog_unit_error
262         (p_module_name => 'update_special_attribute'
263         ,p_hook_type   => 'AP'
264         );
265     --
266     -- End of API User Hook for the after hook of update_special_attribute
267     --
268   end;
269   --
270   hr_utility.set_location(l_proc, 60);
271   --
272   -- When in validation only mode raise the Validate_Enabled exception
273   --
274   if p_validate then
275     raise hr_api.validate_enabled;
276   end if;
277   --
278   -- Set all output arguments
279   --
280   p_object_version_number := l_object_version_number;
281   --
282   hr_utility.set_location(' Leaving:'||l_proc, 70);
283   --
284 exception
285   --
286   when hr_api.validate_enabled then
287     --
288     -- As the Validate_Enabled exception has been raised
289     -- we must rollback to the savepoint
290     --
291     ROLLBACK TO update_special_attribute;
292     --
293     -- Only set output warning arguments
294     -- (Any key or derived arguments must be set to null
295     -- when validation only mode is being used.)
296     --
297     hr_utility.set_location(' Leaving:'||l_proc, 80);
298     --
299   when others then
300      p_object_version_number := l_object_version_number;
301     --
302     -- A validation or unexpected error has occured
303     --
304     ROLLBACK TO update_special_attribute;
305     raise;
306     --
307 end update_special_attribute;
308 -- ----------------------------------------------------------------------------
309 -- |------------------------< delete_special_attribute >----------------------|
310 -- ----------------------------------------------------------------------------
311 --
312 procedure delete_special_attribute
313   (p_validate                       in  boolean  default false
314   ,p_special_attribute_id           in  number
315   ,p_object_version_number          in number
316   ,p_effective_date                 in  date
317   ) is
318   --
319   -- Declare cursors and local variables
320   --
321   l_proc varchar2(72) := g_package||'delete_special_attribute';
322   l_object_version_number pqh_special_attributes.object_version_number%TYPE;
323   --
324 begin
325   --
326   hr_utility.set_location('Entering:'|| l_proc, 10);
327   --
328   -- Issue a savepoint if operating in validation only mode
329   --
330   savepoint delete_special_attribute;
331   --
332   hr_utility.set_location(l_proc, 20);
333   --
334   -- Process Logic
335   --
336   l_object_version_number := p_object_version_number;
337   --
338   --
339   begin
340     --
341     -- Start of API User Hook for the before hook of delete_special_attribute
342     --
343     pqh_special_attributes_bk3.delete_special_attribute_b
344       (
345        p_special_attribute_id           =>  p_special_attribute_id
346       ,p_object_version_number          =>  p_object_version_number
347     ,p_effective_date                      => trunc(p_effective_date)
348       );
349   exception
350     when hr_api.cannot_find_prog_unit then
351       hr_api.cannot_find_prog_unit_error
352         (p_module_name => 'delete_special_attribute'
353         ,p_hook_type   => 'BP'
354         );
355     --
356     -- End of API User Hook for the before hook of delete_special_attribute
357     --
358   end;
359   --
360   pqh_sat_del.del
361     (
362      p_special_attribute_id          => p_special_attribute_id
363     ,p_object_version_number         => l_object_version_number
364     ,p_effective_date                => p_effective_date
365     );
366   --
367   begin
368     --
369     -- Start of API User Hook for the after hook of delete_special_attribute
370     --
371     pqh_special_attributes_bk3.delete_special_attribute_a
372       (
373        p_special_attribute_id           =>  p_special_attribute_id
374       ,p_object_version_number          =>  l_object_version_number
375     ,p_effective_date                      => trunc(p_effective_date)
376       );
377   exception
378     when hr_api.cannot_find_prog_unit then
379       hr_api.cannot_find_prog_unit_error
380         (p_module_name => 'delete_special_attribute'
381         ,p_hook_type   => 'AP'
382         );
383     --
384     -- End of API User Hook for the after hook of delete_special_attribute
385     --
386   end;
387   --
388   hr_utility.set_location(l_proc, 60);
389   --
390   -- When in validation only mode raise the Validate_Enabled exception
391   --
392   if p_validate then
393     raise hr_api.validate_enabled;
394   end if;
395   --
396   hr_utility.set_location(' Leaving:'||l_proc, 70);
397   --
398 exception
399   --
400   when hr_api.validate_enabled then
401     --
402     -- As the Validate_Enabled exception has been raised
403     -- we must rollback to the savepoint
404     --
405     ROLLBACK TO delete_special_attribute;
406     --
407     -- Only set output warning arguments
408     -- (Any key or derived arguments must be set to null
409     -- when validation only mode is being used.)
410     --
411     --
412   when others then
413     --
414     -- A validation or unexpected error has occured
415     --
416     ROLLBACK TO delete_special_attribute;
417     raise;
418     --
419 end delete_special_attribute;
420 --
421 -- ----------------------------------------------------------------------------
422 -- |-------------------------------< lck >------------------------------------|
423 -- ----------------------------------------------------------------------------
424 --
425 procedure lck
426   (
427    p_special_attribute_id                   in     number
428   ,p_object_version_number          in     number
429   ) is
430   --
431   --
432   -- Declare cursors and local variables
433   --
434   l_proc varchar2(72) := g_package||'lck';
435   --
436 begin
437   --
438   hr_utility.set_location('Entering:'|| l_proc, 10);
439   --
440   pqh_sat_shd.lck
441     (
442       p_special_attribute_id                 => p_special_attribute_id
443      ,p_object_version_number      => p_object_version_number
444     );
445   --
446   hr_utility.set_location(' Leaving:'||l_proc, 70);
447   --
448 end lck;
449 --
450 --
451 
452 
453 end pqh_special_attributes_api;