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