DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_AUTHORIA_VARIABLEMAP_API

Source


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