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