DBA Data[Home] [Help]

PACKAGE BODY: APPS.GHR_NOAC_REMARKS_API

Source


1 Package Body ghr_noac_remarks_api as
2 /* $Header: ghnreapi.pkb 115.1 99/10/14 12:10:50 porting ship  $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  ghr_noac_remarks_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_noac_remarks >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_noac_remarks
13   (p_validate                       in  boolean   default false
14   ,p_noac_remark_id                 out number
15   ,p_nature_of_action_id            in  number    default null
16   ,p_remark_id                      in  number    default null
17   ,p_required_flag                  in  varchar2  default null
18   ,p_enabled_flag                   in  varchar2  default null
19   ,p_date_from                      in  date      default null
20   ,p_date_to                        in  date      default null
21   ,p_object_version_number          out number
22   ,p_effective_date                 in  date
23   ) is
24   --
25   -- Declare cursors and local variables
26   --
27   l_noac_remark_id ghr_noac_remarks.noac_remark_id%TYPE;
28   l_proc varchar2(72) := g_package||'create_noac_remarks';
29   l_object_version_number ghr_noac_remarks.object_version_number%TYPE;
30   l_date_from   date;
31   l_date_to     date;
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_noac_remarks;
40   --
41   hr_utility.set_location(l_proc, 20);
42   --
43   -- Process Logic
44   --
45   -- Truncate the time portion from all IN date parameters
46   --
47      l_date_from := trunc(p_date_from);
48      l_date_to   := trunc(p_date_to);
49 
50   --
51   begin
52     --
53     -- Start of API User Hook for the before hook of create_noac_remarks
54     --
55     ghr_noac_remarks_bk1.create_noac_remarks_b
56       (
57        p_nature_of_action_id            =>  p_nature_of_action_id
58       ,p_remark_id                      =>  p_remark_id
59       ,p_required_flag                  =>  p_required_flag
60       ,p_enabled_flag                   =>  p_enabled_flag
61       ,p_date_from                      =>  l_date_from
62       ,p_date_to                        =>  p_date_to
63       ,p_effective_date               => trunc(p_effective_date)
64       );
65   exception
66     when hr_api.cannot_find_prog_unit then
67       hr_api.cannot_find_prog_unit_error
68         (
69          p_module_name => 'CREATE_noac_remarks'
70         ,p_hook_type   => 'BP'
71         );
72     --
73     -- End of API User Hook for the before hook of create_noac_remarks
74     --
75   end;
76   --
77   ghr_nre_ins.ins
78     (
79      p_noac_remark_id                => l_noac_remark_id
80     ,p_nature_of_action_id           => p_nature_of_action_id
81     ,p_remark_id                     => p_remark_id
82     ,p_required_flag                 => p_required_flag
83     ,p_enabled_flag                  => p_enabled_flag
84     ,p_date_from                     => l_date_from
85     ,p_date_to                       => p_date_to
86     ,p_object_version_number         => l_object_version_number
87     ,p_effective_date                => trunc(p_effective_date)
88     );
89   --
90   begin
91     --
92     -- Start of API User Hook for the after hook of create_noac_remarks
93     --
94     ghr_noac_remarks_bk1.create_noac_remarks_a
95       (
96        p_noac_remark_id                 =>  l_noac_remark_id
97       ,p_nature_of_action_id            =>  p_nature_of_action_id
98       ,p_remark_id                      =>  p_remark_id
99       ,p_required_flag                  =>  p_required_flag
100       ,p_enabled_flag                   =>  p_enabled_flag
101       ,p_date_from                      =>  l_date_from
102       ,p_date_to                        =>  p_date_to
103       ,p_object_version_number          =>  l_object_version_number
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_noac_remarks'
110         ,p_hook_type   => 'AP'
111         );
112     --
113     -- End of API User Hook for the after hook of create_noac_remarks
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_noac_remark_id := l_noac_remark_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_noac_remarks;
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_noac_remark_id := null;
146     p_object_version_number  := null;
147     hr_utility.set_location(' Leaving:'||l_proc, 80);
148     --
149   when others then
150     --
151     -- A validation or unexpected error has occured
152     --
153     ROLLBACK TO create_noac_remarks;
154     raise;
155     --
156 end create_noac_remarks;
157 -- ----------------------------------------------------------------------------
158 -- |------------------------< update_noac_remarks >--- ------------------|
159 -- ----------------------------------------------------------------------------
160 --
161 procedure update_noac_remarks
162   (p_validate                       in  boolean   default false
163   ,p_noac_remark_id                 in  number
164   ,p_nature_of_action_id            in  number    default hr_api.g_number
165   ,p_remark_id                      in  number    default hr_api.g_number
166   ,p_required_flag                  in  varchar2  default hr_api.g_varchar2
167   ,p_enabled_flag                   in  varchar2  default hr_api.g_varchar2
168   ,p_date_from                      in  date      default hr_api.g_date
169   ,p_date_to                        in  date      default hr_api.g_date
170   ,p_object_version_number          in out number
171   ,p_effective_date                 in  date
172   ) is
173   --
174   -- Declare cursors and local variables
175   --
176   l_proc varchar2(72) := g_package||'update_noac_remarks';
177   l_object_version_number ghr_noac_remarks.object_version_number%TYPE;
178   l_date_from   date;
179   l_date_to     date;
180   --
181 begin
182   --
183   hr_utility.set_location('Entering:'|| l_proc, 10);
184   --
185   -- Issue a savepoint if operating in validation only mode
186   --
187   savepoint update_noac_remarks;
188   --
189   hr_utility.set_location(l_proc, 20);
190   --
191   -- Process Logic
192   --
193   --
194   -- Truncate the time portion from all IN date parameters
195   --
196      l_date_from := trunc(p_date_from);
197      l_date_to   := trunc(p_date_to);
198 
199   --
200   l_object_version_number := p_object_version_number;
201   --
202   begin
203     --
204     -- Start of API User Hook for the before hook of update_noac_remarks
205     --
206     ghr_noac_remarks_bk2.update_noac_remarks_b
207       (
208        p_noac_remark_id                 =>  p_noac_remark_id
209       ,p_nature_of_action_id            =>  p_nature_of_action_id
210       ,p_remark_id                      =>  p_remark_id
211       ,p_required_flag                  =>  p_required_flag
212       ,p_enabled_flag                   =>  p_enabled_flag
213       ,p_date_from                      =>  l_date_from
214       ,p_date_to                        =>  p_date_to
215       ,p_object_version_number          =>  p_object_version_number
216     ,p_effective_date                 => trunc(p_effective_date)
217       );
218   exception
219     when hr_api.cannot_find_prog_unit then
220       hr_api.cannot_find_prog_unit_error
221         (p_module_name => 'UPDATE_noac_remarks'
222         ,p_hook_type   => 'BP'
223         );
224     --
225     -- End of API User Hook for the before hook of update_noac_remarks
226     --
227   end;
228   --
229   ghr_nre_upd.upd
230     (
231      p_noac_remark_id                => p_noac_remark_id
232     ,p_nature_of_action_id           => p_nature_of_action_id
233     ,p_remark_id                     => p_remark_id
234     ,p_required_flag                 => p_required_flag
235     ,p_enabled_flag                  => p_enabled_flag
236     ,p_date_from                     => l_date_from
237     ,p_date_to                       => p_date_to
238     ,p_object_version_number         => l_object_version_number
239     ,p_effective_date                => trunc(p_effective_date)
240     );
241   --
242   begin
243     --
244     -- Start of API User Hook for the after hook of update_noac_remarks
245     --
246     ghr_noac_remarks_bk2.update_noac_remarks_a
247       (
248        p_noac_remark_id                 =>  p_noac_remark_id
249       ,p_nature_of_action_id            =>  p_nature_of_action_id
250       ,p_remark_id                      =>  p_remark_id
251       ,p_required_flag                  =>  p_required_flag
252       ,p_enabled_flag                   =>  p_enabled_flag
253       ,p_date_from                      =>  l_date_from
254       ,p_date_to                        =>  p_date_to
255       ,p_object_version_number          =>  l_object_version_number
256       ,p_effective_date                => trunc(p_effective_date)
257       );
258   exception
259     when hr_api.cannot_find_prog_unit then
260       hr_api.cannot_find_prog_unit_error
261         (p_module_name => 'UPDATE_noac_remarks'
262         ,p_hook_type   => 'AP'
263         );
264     --
265     -- End of API User Hook for the after hook of update_noac_remarks
266     --
267   end;
268   --
269   hr_utility.set_location(l_proc, 60);
270   --
271   -- When in validation only mode raise the Validate_Enabled exception
272   --
273   if p_validate then
274     raise hr_api.validate_enabled;
275   end if;
276   --
277   -- Set all output arguments
278   --
279   p_object_version_number := l_object_version_number;
280   --
281   hr_utility.set_location(' Leaving:'||l_proc, 70);
282   --
283 exception
284   --
285   when hr_api.validate_enabled then
286     --
287     -- As the Validate_Enabled exception has been raised
288     -- we must rollback to the savepoint
289     --
290     ROLLBACK TO update_noac_remarks;
291     --
292     -- Only set output warning arguments
293     -- (Any key or derived arguments must be set to null
294     -- when validation only mode is being used.)
295     --
296     hr_utility.set_location(' Leaving:'||l_proc, 80);
297     --
298   when others then
299     --
300     -- A validation or unexpected error has occured
301     --
302     ROLLBACK TO update_noac_remarks;
303     raise;
304     --
305 end update_noac_remarks;
306 -- ----------------------------------------------------------------------------
307 -- |------------------------< delete_noac_remarks >----------------------|
308 -- ----------------------------------------------------------------------------
309 --
310 procedure delete_noac_remarks
311   (p_validate                       in  boolean  default false
312   ,p_noac_remark_id                 in  number
313   ,p_object_version_number          in out number
314   ,p_effective_date                 in  date
315   ) is
316   --
317   -- Declare cursors and local variables
318   --
319   l_proc varchar2(72) := g_package||'update_noac_remarks';
320   l_object_version_number ghr_noac_remarks.object_version_number%TYPE;
321   --
322 begin
323   --
324   hr_utility.set_location('Entering:'|| l_proc, 10);
325   --
326   -- Issue a savepoint if operating in validation only mode
327   --
328   savepoint delete_noac_remarks;
329   --
330   hr_utility.set_location(l_proc, 20);
331   --
332   -- Process Logic
333   --
334   l_object_version_number := p_object_version_number;
335   --
336   --
337   begin
338     --
339     -- Start of API User Hook for the before hook of delete_noac_remarks
340     --
341     ghr_noac_remarks_bk3.delete_noac_remarks_b
342       (
343        p_noac_remark_id                 =>  p_noac_remark_id
344       ,p_object_version_number          =>  p_object_version_number
345     ,p_effective_date                      => trunc(p_effective_date)
346       );
347   exception
348     when hr_api.cannot_find_prog_unit then
349       hr_api.cannot_find_prog_unit_error
350         (p_module_name => 'DELETE_noac_remarks'
351         ,p_hook_type   => 'BP'
352         );
353     --
354     -- End of API User Hook for the before hook of delete_noac_remarks
355     --
356   end;
357   --
358   ghr_nre_del.del
359     (
360      p_noac_remark_id                => p_noac_remark_id
361     ,p_object_version_number         => l_object_version_number
362     ,p_effective_date                => p_effective_date
363     );
364   --
365   begin
366     --
367     -- Start of API User Hook for the after hook of delete_noac_remarks
368     --
369     ghr_noac_remarks_bk3.delete_noac_remarks_a
370       (
371        p_noac_remark_id                 =>  p_noac_remark_id
372       ,p_object_version_number          =>  l_object_version_number
373     ,p_effective_date                      => trunc(p_effective_date)
374       );
375   exception
376     when hr_api.cannot_find_prog_unit then
377       hr_api.cannot_find_prog_unit_error
378         (p_module_name => 'DELETE_noac_remarks'
379         ,p_hook_type   => 'AP'
380         );
381     --
382     -- End of API User Hook for the after hook of delete_noac_remarks
383     --
384   end;
385   --
386   hr_utility.set_location(l_proc, 60);
387   --
388   -- When in validation only mode raise the Validate_Enabled exception
389   --
390   if p_validate then
391     raise hr_api.validate_enabled;
392   end if;
393   --
394   hr_utility.set_location(' Leaving:'||l_proc, 70);
395   --
396 exception
397   --
398   when hr_api.validate_enabled then
399     --
400     -- As the Validate_Enabled exception has been raised
401     -- we must rollback to the savepoint
402     --
403     ROLLBACK TO delete_noac_remarks;
404     --
405     -- Only set output warning arguments
406     -- (Any key or derived arguments must be set to null
407     -- when validation only mode is being used.)
408     --
409     --
410   when others then
411     --
412     -- A validation or unexpected error has occured
413     --
414     ROLLBACK TO delete_noac_remarks;
415     raise;
416     --
417 end delete_noac_remarks;
418 --
419 -- ----------------------------------------------------------------------------
420 -- |-------------------------------< lck >------------------------------------|
421 -- ----------------------------------------------------------------------------
422 --
423 procedure lck
424   (
425    p_noac_remark_id                   in     number
426   ,p_object_version_number          in     number
427   ) is
428   --
429   --
430   -- Declare cursors and local variables
431   --
432   l_proc varchar2(72) := g_package||'lck';
433   --
434 begin
435   --
436   hr_utility.set_location('Entering:'|| l_proc, 10);
437   --
438   ghr_nre_shd.lck
439     (
440       p_noac_remark_id                 => p_noac_remark_id
441      ,p_object_version_number      => p_object_version_number
442     );
443   --
444   hr_utility.set_location(' Leaving:'||l_proc, 70);
445   --
446 end lck;
447 --
448 end ghr_noac_remarks_api;