[Home] [Help]
PACKAGE BODY: APPS.HXC_ALIAS_TYPES_API
Source
1 Package Body hxc_alias_types_api as
2 /* $Header: hxchatapi.pkb 120.2 2005/09/23 10:41:01 sechandr noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' hxc_alias_types_api. ';
7 g_debug boolean :=hr_utility.debug_enabled;
8 --
9 -- ----------------------------------------------------------------------------
10 -- |--------------------------< create_alias_types >--------------------------|
11 -- ----------------------------------------------------------------------------
12 --
13 procedure create_alias_types
14 (p_validate in boolean default false,
15 p_alias_type in varchar2,
16 p_reference_object in varchar2,
17 p_alias_type_id out nocopy number,
18 p_object_version_number out nocopy number
19 ) is
20 --
21 -- Declare cursors and local variables
22 --
23 l_alias_type_id hxc_alias_types.alias_type_id%TYPE;
24 l_object_version_number hxc_alias_types.object_version_number%TYPE;
25 l_proc varchar2(72);
26 begin
27 g_debug:=hr_utility.debug_enabled;
28 if g_debug then
29 l_proc := g_package||'create_alias_types';
30 hr_utility.set_location('Entering:'|| l_proc, 10);
31 end if;
32 --
33 -- Issue a savepoint
34 --
35 savepoint create_alias_types;
36 --
37 -- Truncate the time portion from all IN date parameters
38 --
39
40 --
41 -- Call Before Process User Hook
42 --
43 begin
44 hxc_alias_types_bk1.create_alias_types_b
45 (p_alias_type => p_alias_type,
46 p_reference_object => p_reference_object,
47 p_alias_type_id => p_alias_type_id,
48 p_object_version_number => p_object_version_number
49 );
50 exception
51 when hr_api.cannot_find_prog_unit then
52 hr_api.cannot_find_prog_unit_error
53 (p_module_name => 'create_alias_types'
54 ,p_hook_type => 'BP'
55 );
56 end;
57 --
58 -- Validation in addition to Row Handlers
59 --
60
61
62
63 --
64 -- Process Logic
65 --
66
67 hxc_hat_ins.ins (
68 p_alias_type => p_alias_type,
69 p_reference_object => p_reference_object,
70 p_alias_type_id => l_alias_type_id,
71 p_object_version_number => l_object_version_number
72 );
73
74 --
75 -- Call After Process User Hook
76 --
77 begin
78 hxc_alias_types_bk1.create_alias_types_a
79 (p_alias_type => p_alias_type,
80 p_reference_object => p_reference_object,
81 p_alias_type_id => p_alias_type_id,
82 p_object_version_number => p_object_version_number
83 );
84 exception
85 when hr_api.cannot_find_prog_unit then
86 hr_api.cannot_find_prog_unit_error
87 (p_module_name => 'create_alias_types'
88 ,p_hook_type => 'AP'
89 );
90 end;
91 --
92 -- When in validation only mode raise the Validate_Enabled exception
93 --
94 if p_validate then
95 raise hr_api.validate_enabled;
96 end if;
97 --
98 -- Set all output arguments
99 --
100 p_alias_type_id := l_alias_type_id;
101 p_object_version_number := l_object_version_number;
102 --
103 if g_debug then
104 hr_utility.set_location(' Leaving:'||l_proc, 70);
105 end if;
106 exception
107 when hr_api.validate_enabled then
108 --
109 -- As the Validate_Enabled exception has been raised
110 -- we must rollback to the savepoint
111 --
112 rollback to create_alias_types;
113 --
114 -- Only set output warning arguments
115 -- (Any key or derived arguments must be set to null
116 -- when validation only mode is being used.)
117 --
118 p_alias_type_id := null;
119 p_object_version_number := null;
120
121 if g_debug then
122 hr_utility.set_location(' Leaving:'||l_proc, 80);
123 end if;
124 when others then
125 --
126 -- A validation or unexpected error has occured
127 --
128 rollback to create_alias_types;
129 if g_debug then
130 hr_utility.set_location(' Leaving:'||l_proc, 90);
131 end if;
132 raise;
133 end create_alias_types;
134 --
135
136 -- ----------------------------------------------------------------------------
137 -- |--------------------------< update_alias_types >--------------------------|
138 -- ----------------------------------------------------------------------------
139 --
140 procedure update_alias_types
141 (p_validate in boolean default false,
142 p_alias_type in varchar2,
143 p_reference_object in varchar2,
144 p_alias_type_id in number,
145 p_object_version_number in out nocopy number
146 ) is
147 --
148 -- Declare cursors and local variables
149 --
150 l_object_version_number hxc_alias_types.object_version_number%TYPE := p_object_version_number;
151 l_proc varchar2(72);
152 begin
153 g_debug:=hr_utility.debug_enabled;
154 if g_debug then
155 l_proc := g_package||'update_alias_types';
156 hr_utility.set_location('Entering:'|| l_proc, 10);
157 end if;
158 --
159 -- Issue a savepoint
160 --
161 savepoint update_alias_types;
162 --
163 -- Truncate the time portion from all IN date parameters
164 --
165 --
166 -- Call Before Process User Hook
167 --
168 begin
169 hxc_alias_types_bk1.update_alias_types_b
170 (p_alias_type => p_alias_type,
171 p_reference_object => p_reference_object,
172 p_alias_type_id => p_alias_type_id,
173 p_object_version_number => p_object_version_number
174 );
175 exception
176 when hr_api.cannot_find_prog_unit then
177 hr_api.cannot_find_prog_unit_error
178 (p_module_name => 'create_alias_types'
179 ,p_hook_type => 'BP'
180 );
181 end;
182 --
183 -- Validation in addition to Row Handlers
184 --
185 --
186 -- Process Logic
187 --
188 hxc_hat_upd.upd (
189 p_alias_type => p_alias_type,
190 p_reference_object => p_reference_object,
191 p_alias_type_id => p_alias_type_id,
192 p_object_version_number => l_object_version_number
193 );
194
195 --
196 -- Call After Process User Hook
197 --
198 begin
199 hxc_alias_types_bk1.update_alias_types_a
200 (p_alias_type => p_alias_type,
201 p_reference_object => p_reference_object,
202 p_alias_type_id => p_alias_type_id,
203 p_object_version_number => p_object_version_number
204 );
205 exception
206 when hr_api.cannot_find_prog_unit then
207 hr_api.cannot_find_prog_unit_error
208 (p_module_name => 'update_alias_types'
209 ,p_hook_type => 'AP'
210 );
211 end;
212 --
213 -- When in validation only mode raise the Validate_Enabled exception
214 --
215 if p_validate then
216 raise hr_api.validate_enabled;
217 end if;
218 --
219 --
220 -- Set all output arguments
221 --
222 p_object_version_number := l_object_version_number;
223 --
224 if g_debug then
225 hr_utility.set_location(' Leaving:'||l_proc, 70);
226 end if;
227 exception
228 when hr_api.validate_enabled then
229 --
230 -- As the Validate_Enabled exception has been raised
231 -- we must rollback to the savepoint
232 --
233 rollback to update_alias_types;
234 --
235 -- Only set output warning arguments
236 -- (Any key or derived arguments must be set to null
237 -- when validation only mode is being used.)
238 --
239 if g_debug then
240 hr_utility.set_location(' Leaving:'||l_proc, 80);
241 end if;
242 when others then
243 --
244 -- A validation or unexpected error has occured
245 --
246 rollback to update_alias_types;
247 if g_debug then
248 hr_utility.set_location(' Leaving:'||l_proc, 90);
249 end if;
250 raise;
251 end update_alias_types;
252 --
253
254 -- ----------------------------------------------------------------------------
255 -- |--------------------------< delete_alias_types >--------------------------|
256 -- ----------------------------------------------------------------------------
257 --
258 procedure delete_alias_types
259 (p_validate in boolean default FALSE,
260 p_alias_type_id in number,
261 p_object_version_number in number
262 ) is
263 --
264 -- Declare cursors and local variables
265 --
266
267 l_proc varchar2(72);
268 begin
269 g_debug:=hr_utility.debug_enabled;
270 if g_debug then
271 l_proc := g_package||'delete_alias_types';
272 hr_utility.set_location('Entering:'|| l_proc, 10);
273 end if;
274 --
275 -- Issue a savepoint
276 --
277 savepoint delete_alias_types;
278 --
279 -- Truncate the time portion from all IN date parameters
280 if g_debug then
281 hr_utility.trace('Before calling Before User Hook');
282 end if;
283 --
284 --
285 -- Call Before Process User Hook
286 --
287 begin
288 hxc_alias_types_bk1.delete_alias_types_b
289 (p_alias_type_id => p_alias_type_id,
290 p_object_version_number => p_object_version_number
291 );
292 exception
293 when hr_api.cannot_find_prog_unit then
294 hr_api.cannot_find_prog_unit_error
295 (p_module_name => 'delete_alias_types'
296 ,p_hook_type => 'BP'
297 );
298 end;
299 --
300 -- Validation in addition to Row Handlers
301 --
302 --
303 -- Process Logic
304 --
305
306 if g_debug then
307 hr_utility.trace ('Before Calling Row Handler');
308 end if;
309 hxc_hat_del.del (
310 p_alias_type_id => p_alias_type_id,
311 p_object_version_number => p_object_version_number
312 );
313
314 if g_debug then
315 hr_utility.trace('Before calling after user hook');
316 end if;
317 --
318 -- Call After Process User Hook
319 --
320 begin
321 hxc_alias_types_bk1.delete_alias_types_a
322 (p_alias_type_id => p_alias_type_id,
323 p_object_version_number => p_object_version_number
324 );
325 exception
326 when hr_api.cannot_find_prog_unit then
327 hr_api.cannot_find_prog_unit_error
328 (p_module_name => 'delete_alias_types'
329 ,p_hook_type => 'AP'
330 );
331 end;
332 if g_debug then
333 hr_utility.trace('After User hook');
334 end if;
335 --
336 -- When in validation only mode raise the Validate_Enabled exception
337 --
338 if p_validate then
339 raise hr_api.validate_enabled;
340 end if;
341 --
342 --
343 -- Set all output arguments
344 --
345 --
346 if g_debug then
347 hr_utility.set_location(' Leaving:'||l_proc, 70);
348 end if;
349 exception
350 when hr_api.validate_enabled then
351 --
352 -- As the Validate_Enabled exception has been raised
353 -- we must rollback to the savepoint
354 --
355 rollback to delete_alias_types;
356 --
357 -- Only set output warning arguments
358 -- (Any key or derived arguments must be set to null
359 -- when validation only mode is being used.)
360 --
361 if g_debug then
362 hr_utility.set_location(' Leaving:'||l_proc, 80);
363 end if;
364 when others then
365 --
366 -- A validation or unexpected error has occured
367 --
368 rollback to delete_alias_types;
369 if g_debug then
370 hr_utility.set_location(' Leaving:'||l_proc, 90);
371 end if;
372 raise;
373 end delete_alias_types;
374 --
375
376 end hxc_alias_types_api;