[Home] [Help]
PACKAGE BODY: APPS.HR_SALARY_SURVEY_API
Source
1 Package Body hr_salary_survey_api as
2 /* $Header: pepssapi.pkb 115.4 2003/02/12 11:37:46 eumenyio ship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' hr_salary_survey_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< create_salary_survey >--------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_salary_survey
13 (p_validate in boolean default false
14 ,p_survey_name in varchar2
15 ,p_survey_company_code in varchar2
16 ,p_identifier in varchar2
17 --ras ,p_currency_code in varchar2
18 ,p_survey_type_code in varchar2
19 ,p_base_region in varchar2 default null
20 ,p_effective_date in date default null
21 ,p_attribute_category in varchar2 default null
22 ,p_attribute1 in varchar2 default null
23 ,p_attribute2 in varchar2 default null
24 ,p_attribute3 in varchar2 default null
25 ,p_attribute4 in varchar2 default null
26 ,p_attribute5 in varchar2 default null
27 ,p_attribute6 in varchar2 default null
28 ,p_attribute7 in varchar2 default null
29 ,p_attribute8 in varchar2 default null
30 ,p_attribute9 in varchar2 default null
31 ,p_attribute10 in varchar2 default null
32 ,p_attribute11 in varchar2 default null
33 ,p_attribute12 in varchar2 default null
34 ,p_attribute13 in varchar2 default null
35 ,p_attribute14 in varchar2 default null
36 ,p_attribute15 in varchar2 default null
37 ,p_attribute16 in varchar2 default null
38 ,p_attribute17 in varchar2 default null
39 ,p_attribute18 in varchar2 default null
40 ,p_attribute19 in varchar2 default null
41 ,p_attribute20 in varchar2 default null
42 ,p_salary_survey_id out nocopy number
43 ,p_object_version_number out nocopy number
44 ) is
45 --
46 -- Declare cursors and local variables
47 --
48 l_proc varchar2(72) := g_package||'create_salary_survey';
49 --
50 l_salary_survey_id per_salary_surveys.salary_survey_id%TYPE;
51 l_object_version_number per_salary_surveys.object_version_number%TYPE;
52 --
53 begin
54 hr_utility.set_location('Entering:'|| l_proc, 10);
55 --
56 -- Issue a savepoint
57 --
58 savepoint create_salary_survey;
59 hr_utility.set_location(l_proc, 20);
60 --
61 -- Call Before Process User Hook
62 --
63 begin
64 hr_salary_survey_bk1.create_salary_survey_b
65 (p_survey_name => p_survey_name
66 ,p_survey_company_code => p_survey_company_code
67 ,p_identifier => p_identifier
68 --ras ,p_currency_code => p_currency_code
69 ,p_survey_type_code => p_survey_type_code
70 ,p_base_region => p_base_region
71 ,p_effective_date => p_effective_date
72 ,p_attribute_category => p_attribute_category
73 ,p_attribute1 => p_attribute1
74 ,p_attribute2 => p_attribute2
75 ,p_attribute3 => p_attribute3
76 ,p_attribute4 => p_attribute4
77 ,p_attribute5 => p_attribute5
78 ,p_attribute6 => p_attribute6
79 ,p_attribute7 => p_attribute7
80 ,p_attribute8 => p_attribute8
81 ,p_attribute9 => p_attribute9
82 ,p_attribute10 => p_attribute10
83 ,p_attribute11 => p_attribute11
84 ,p_attribute12 => p_attribute12
85 ,p_attribute13 => p_attribute13
86 ,p_attribute14 => p_attribute14
87 ,p_attribute15 => p_attribute15
88 ,p_attribute16 => p_attribute16
89 ,p_attribute17 => p_attribute17
90 ,p_attribute18 => p_attribute18
91 ,p_attribute19 => p_attribute19
92 ,p_attribute20 => p_attribute20
93 );
94 exception
95 when hr_api.cannot_find_prog_unit then
96 hr_api.cannot_find_prog_unit_error
97 (p_module_name => 'create_salary_survey'
98 ,p_hook_type => 'BP'
99 );
100 end;
101 hr_utility.set_location(l_proc, 30);
102 --
103 -- Process Logic
104 --
105 per_pss_ins.ins(p_salary_survey_id => l_salary_survey_id
106 ,p_object_version_number => l_object_version_number
107 ,p_survey_name => p_survey_name
108 ,p_survey_company_code => p_survey_company_code
109 ,p_identifier => p_identifier
110 --ras ,p_currency_code => p_currency_code
111 ,p_survey_type_code => p_survey_type_code
112 ,p_base_region => p_base_region
113 ,p_effective_date => p_effective_date
114 ,p_attribute_category => p_attribute_category
115 ,p_attribute1 => p_attribute1
116 ,p_attribute2 => p_attribute2
117 ,p_attribute3 => p_attribute3
118 ,p_attribute4 => p_attribute4
119 ,p_attribute5 => p_attribute5
120 ,p_attribute6 => p_attribute6
121 ,p_attribute7 => p_attribute7
122 ,p_attribute8 => p_attribute8
123 ,p_attribute9 => p_attribute9
124 ,p_attribute10 => p_attribute10
125 ,p_attribute11 => p_attribute11
126 ,p_attribute12 => p_attribute12
127 ,p_attribute13 => p_attribute13
128 ,p_attribute14 => p_attribute14
129 ,p_attribute15 => p_attribute15
130 ,p_attribute16 => p_attribute16
131 ,p_attribute17 => p_attribute17
132 ,p_attribute18 => p_attribute18
133 ,p_attribute19 => p_attribute19
134 ,p_attribute20 => p_attribute20
135 );
136 hr_utility.set_location(l_proc, 50);
137 --
138 -- Call After Process User Hook
139 --
140 begin
141 hr_salary_survey_bk1.create_salary_survey_a
142 (p_survey_name => p_survey_name
143 ,p_survey_company_code => p_survey_company_code
144 ,p_identifier => p_identifier
145 --ras ,p_currency_code => p_currency_code
146 ,p_survey_type_code => p_survey_type_code
147 ,p_base_region => p_base_region
148 ,p_effective_date => p_effective_date
149 ,p_attribute_category => p_attribute_category
150 ,p_attribute1 => p_attribute1
151 ,p_attribute2 => p_attribute2
152 ,p_attribute3 => p_attribute3
153 ,p_attribute4 => p_attribute4
154 ,p_attribute5 => p_attribute5
155 ,p_attribute6 => p_attribute6
156 ,p_attribute7 => p_attribute7
157 ,p_attribute8 => p_attribute8
158 ,p_attribute9 => p_attribute9
159 ,p_attribute10 => p_attribute10
160 ,p_attribute11 => p_attribute11
161 ,p_attribute12 => p_attribute12
162 ,p_attribute13 => p_attribute13
163 ,p_attribute14 => p_attribute14
164 ,p_attribute15 => p_attribute15
165 ,p_attribute16 => p_attribute16
166 ,p_attribute17 => p_attribute17
167 ,p_attribute18 => p_attribute18
168 ,p_attribute19 => p_attribute19
169 ,p_attribute20 => p_attribute20
170 ,p_salary_survey_id => l_salary_survey_id
171 ,p_object_version_number => l_object_version_number
172 );
173 exception
174 when hr_api.cannot_find_prog_unit then
175 hr_api.cannot_find_prog_unit_error
176 (p_module_name => 'create_salary_survey'
177 ,p_hook_type => 'AP'
178 );
179 end;
180 hr_utility.set_location(l_proc, 60);
181 --
182 -- When in validation only mode raise the Validate_Enabled exception
183 --
184 if p_validate then
185 --
186 raise hr_api.validate_enabled;
187 --
188 end if;
189 --
190 -- Set all output arguments
191 --
192 p_salary_survey_id := l_salary_survey_id;
193 p_object_version_number := l_object_version_number;
194 --
195 hr_utility.set_location(' Leaving:'||l_proc, 70);
196 --
197 exception
198 when hr_api.validate_enabled then
199 --
200 -- As the Validate_Enabled exception has been raised
201 -- we must rollback to the savepoint
202 --
203 rollback to create_salary_survey;
204 --
205 -- Only set output warning arguments
206 -- (Any key or derived arguments must be set to null
207 -- when validation only mode is being used.)
208 --
209 p_salary_survey_id := null;
210 p_object_version_number := null;
211 --
212 hr_utility.set_location(' Leaving:'||l_proc, 80);
213 --
214 when others then
215 --
216 -- A validation or unexpected error has occured
217 --
218 p_salary_survey_id := null;
219 p_object_version_number := null;
220 rollback to create_salary_survey;
221 --
222 hr_utility.set_location(' Leaving:'||l_proc, 90);
223 --
224 raise;
225 --
226 end create_salary_survey;
227 --
228 --
229 -- ----------------------------------------------------------------------------
230 -- |------------------------< update_salary_survey >---------------------------|
231 -- ----------------------------------------------------------------------------
232 --
233 procedure update_salary_survey
234 (p_validate in boolean default false
235 ,p_survey_name in varchar2 default hr_api.g_varchar2
236 --ras ,p_currency_code in varchar2 default hr_api.g_varchar2
237 ,p_survey_type_code in varchar2 default hr_api.g_varchar2
238 ,p_base_region in varchar2 default hr_api.g_varchar2
239 ,p_effective_date in date default hr_api.g_date
240 ,p_attribute_category in varchar2 default hr_api.g_varchar2
241 ,p_attribute1 in varchar2 default hr_api.g_varchar2
242 ,p_attribute2 in varchar2 default hr_api.g_varchar2
243 ,p_attribute3 in varchar2 default hr_api.g_varchar2
244 ,p_attribute4 in varchar2 default hr_api.g_varchar2
245 ,p_attribute5 in varchar2 default hr_api.g_varchar2
246 ,p_attribute6 in varchar2 default hr_api.g_varchar2
247 ,p_attribute7 in varchar2 default hr_api.g_varchar2
248 ,p_attribute8 in varchar2 default hr_api.g_varchar2
249 ,p_attribute9 in varchar2 default hr_api.g_varchar2
250 ,p_attribute10 in varchar2 default hr_api.g_varchar2
251 ,p_attribute11 in varchar2 default hr_api.g_varchar2
252 ,p_attribute12 in varchar2 default hr_api.g_varchar2
253 ,p_attribute13 in varchar2 default hr_api.g_varchar2
254 ,p_attribute14 in varchar2 default hr_api.g_varchar2
255 ,p_attribute15 in varchar2 default hr_api.g_varchar2
256 ,p_attribute16 in varchar2 default hr_api.g_varchar2
257 ,p_attribute17 in varchar2 default hr_api.g_varchar2
258 ,p_attribute18 in varchar2 default hr_api.g_varchar2
259 ,p_attribute19 in varchar2 default hr_api.g_varchar2
260 ,p_attribute20 in varchar2 default hr_api.g_varchar2
261 ,p_salary_survey_id in number
262 ,p_object_version_number in out nocopy number
263 ) is
264 --
265 -- Declare cursors and local variables
266 --
267 l_proc varchar2(72) := g_package||'update_salary_survey';
268 --
269 l_salary_survey_id per_salary_surveys.salary_survey_id%TYPE;
270 l_object_version_number per_salary_surveys.object_version_number%TYPE;
271 l_temp_ovn number := p_object_version_number;
272 --
273 begin
274 hr_utility.set_location('Entering:'|| l_proc, 10);
275 --
276 -- Issue a savepoint
277 --
278 savepoint update_salary_survey;
279 hr_utility.set_location(l_proc, 20);
280 --
281 -- Call Before Process User Hook
282 --
283 l_object_version_number := p_object_version_number;
284 l_salary_survey_id := p_salary_survey_id;
285 --
286 begin
287 hr_salary_survey_bk2.update_salary_survey_b
288 (p_survey_name => p_survey_name,
289 --ras p_currency_code => p_currency_code,
290 p_survey_type_code => p_survey_type_code,
291 p_base_region => p_base_region,
292 p_effective_date => p_effective_date,
293 p_attribute_category => p_attribute_category,
294 p_attribute1 => p_attribute1,
295 p_attribute2 => p_attribute2,
296 p_attribute3 => p_attribute3,
297 p_attribute4 => p_attribute4,
298 p_attribute5 => p_attribute5,
299 p_attribute6 => p_attribute6,
300 p_attribute7 => p_attribute7,
301 p_attribute8 => p_attribute8,
302 p_attribute9 => p_attribute9,
303 p_attribute10 => p_attribute10,
304 p_attribute11 => p_attribute11,
305 p_attribute12 => p_attribute12,
306 p_attribute13 => p_attribute13,
307 p_attribute14 => p_attribute14,
308 p_attribute15 => p_attribute15,
309 p_attribute16 => p_attribute16,
310 p_attribute17 => p_attribute17,
311 p_attribute18 => p_attribute18,
312 p_attribute19 => p_attribute19,
313 p_attribute20 => p_attribute20,
314 p_object_version_number => l_object_version_number
315 );
316
317 exception
318 when hr_api.cannot_find_prog_unit then
319 hr_api.cannot_find_prog_unit_error
320 (p_module_name => 'update_salary_survey'
321 ,p_hook_type => 'BP'
322 );
323 end;
324 hr_utility.set_location(l_proc, 30);
325 --
326 -- Process Logic
327 --
328 per_pss_upd.upd(p_salary_survey_id => l_salary_survey_id,
329 p_object_version_number => l_object_version_number,
330 p_survey_name => p_survey_name,
331 --ras p_currency_code => p_currency_code,
332 p_survey_type_code => p_survey_type_code,
333 p_base_region => p_base_region,
334 p_effective_date => p_effective_date,
335 p_attribute_category => p_attribute_category,
336 p_attribute1 => p_attribute1,
337 p_attribute2 => p_attribute2,
338 p_attribute3 => p_attribute3,
339 p_attribute4 => p_attribute4,
340 p_attribute5 => p_attribute5,
341 p_attribute6 => p_attribute6,
342 p_attribute7 => p_attribute7,
343 p_attribute8 => p_attribute8,
344 p_attribute9 => p_attribute9,
345 p_attribute10 => p_attribute10,
346 p_attribute11 => p_attribute11,
347 p_attribute12 => p_attribute12,
348 p_attribute13 => p_attribute13,
349 p_attribute14 => p_attribute14,
350 p_attribute15 => p_attribute15,
351 p_attribute16 => p_attribute16,
352 p_attribute17 => p_attribute17,
353 p_attribute18 => p_attribute18,
354 p_attribute19 => p_attribute19,
355 p_attribute20 => p_attribute20
356 );
357 hr_utility.set_location(l_proc, 50);
358 --
359 -- Call After Process User Hook
360 --
361 begin
362 hr_salary_survey_bk2.update_salary_survey_a
363 (p_salary_survey_id => l_salary_survey_id,
364 p_object_version_number => l_object_version_number,
365 p_survey_name => p_survey_name,
366 --ras p_currency_code => p_currency_code,
367 p_survey_type_code => p_survey_type_code,
368 p_base_region => p_base_region,
369 p_effective_date => p_effective_date,
370 p_attribute_category => p_attribute_category,
371 p_attribute1 => p_attribute1,
372 p_attribute2 => p_attribute2,
373 p_attribute3 => p_attribute3,
374 p_attribute4 => p_attribute4,
375 p_attribute5 => p_attribute5,
376 p_attribute6 => p_attribute6,
377 p_attribute7 => p_attribute7,
378 p_attribute8 => p_attribute8,
379 p_attribute9 => p_attribute9,
380 p_attribute10 => p_attribute10,
381 p_attribute11 => p_attribute11,
382 p_attribute12 => p_attribute12,
383 p_attribute13 => p_attribute13,
384 p_attribute14 => p_attribute14,
385 p_attribute15 => p_attribute15,
386 p_attribute16 => p_attribute16,
387 p_attribute17 => p_attribute17,
388 p_attribute18 => p_attribute18,
389 p_attribute19 => p_attribute19,
390 p_attribute20 => p_attribute20
391 );
392 exception
393 when hr_api.cannot_find_prog_unit then
394 hr_api.cannot_find_prog_unit_error
395 (p_module_name => 'update_salary_survey'
396 ,p_hook_type => 'AP'
397 );
398 end;
399 hr_utility.set_location(l_proc, 60);
400 --
401 -- When in validation only mode raise the Validate_Enabled exception
402 --
403 if p_validate then
404 --
405 raise hr_api.validate_enabled;
406 --
407 end if;
408 --
409 -- Set all output arguments
410 --
411 p_object_version_number := l_object_version_number;
412 --
413 hr_utility.set_location(' Leaving:'||l_proc, 70);
414 --
415 exception
416 when hr_api.validate_enabled then
417 --
418 -- As the Validate_Enabled exception has been raised
419 -- we must rollback to the savepoint
420 --
421 rollback to update_salary_survey;
422 --
423 -- Only set output warning arguments
424 -- (Any key or derived arguments must be set to null
425 -- when validation only mode is being used.)
426 --
427 p_object_version_number := null;
428 --
429 hr_utility.set_location(' Leaving:'||l_proc, 80);
430 --
431 when others then
432 --
433 -- A validation or unexpected error has occured
434 --
435 p_object_version_number := l_temp_ovn;
436 rollback to update_salary_survey;
437 --
438 hr_utility.set_location(' Leaving:'||l_proc, 90);
439 --
440 raise;
441 --
442 end update_salary_survey;
443
444 --
445 --
446 -- ----------------------------------------------------------------------------
447 -- |------------------------< delete_salary_survey >---------------------------|
448 -- ----------------------------------------------------------------------------
449 --
450 procedure delete_salary_survey
451 (p_validate in boolean default false
452 ,p_salary_survey_id in number
453 ,p_object_version_number in number
454 ) is
455 --
456 -- Declare cursors and local variables
457 --
458 l_proc varchar2(72) := g_package||'delete_salary_survey';
459 --
460 l_salary_survey_id per_salary_surveys.salary_survey_id%TYPE;
461 l_object_version_number per_salary_surveys.object_version_number%TYPE;
462 --
463 begin
464 hr_utility.set_location('Entering:'|| l_proc, 10);
465 --
466 -- Issue a savepoint
467 --
468 savepoint delete_salary_survey;
469 --
470 hr_utility.set_location(l_proc, 20);
471 --
472 -- Call Before Process User Hook
473 --
474 --
475 l_object_version_number := p_object_version_number;
476 --
477 --
478 l_salary_survey_id := p_salary_survey_id;
479 --
480 begin
481 hr_salary_survey_bk3.delete_salary_survey_b
482 (p_salary_survey_id => l_salary_survey_id
483 ,p_object_version_number => l_object_version_number
484 );
485 exception
486 when hr_api.cannot_find_prog_unit then
487 hr_api.cannot_find_prog_unit_error
488 (p_module_name => 'delete_salary_survey'
489 ,p_hook_type => 'BP'
490 );
491 end;
492 --
493 hr_utility.set_location(l_proc, 30);
494 --
495 -- Process Logic
496 --
497 per_pss_del.del(p_salary_survey_id => l_salary_survey_id
498 ,p_object_version_number => l_object_version_number
499 );
500 --
501 hr_utility.set_location(l_proc, 50);
502 --
503 -- Call After Process User Hook
504 --
505 begin
506 hr_salary_survey_bk3.delete_salary_survey_a
507 (p_salary_survey_id => l_salary_survey_id
508 ,p_object_version_number => l_object_version_number
509 );
510 exception
511 when hr_api.cannot_find_prog_unit then
512 hr_api.cannot_find_prog_unit_error
513 (p_module_name => 'delete_salary_survey'
514 ,p_hook_type => 'AP'
515 );
516 end;
517 hr_utility.set_location(l_proc, 60);
518 --
519 -- When in validation only mode raise the Validate_Enabled exception
520 --
521 if p_validate then
522 --
523 raise hr_api.validate_enabled;
524 --
525 end if;
526 --
527 hr_utility.set_location(' Leaving:'||l_proc, 70);
528 --
529 exception
530 when hr_api.validate_enabled then
531 --
532 -- As the Validate_Enabled exception has been raised
533 -- we must rollback to the savepoint
534 --
535 rollback to delete_salary_survey;
536 --
537 -- Only set output warning arguments
538 -- (Any key or derived arguments must be set to null
539 -- when validation only mode is being used.)
540 --
541 --
542 hr_utility.set_location(' Leaving:'||l_proc, 80);
543 --
544 when others then
545 --
546 -- A validation or unexpected error has occured
547 --
548 rollback to delete_salary_survey;
549 --
550 hr_utility.set_location(' Leaving:'||l_proc, 90);
551 --
552 raise;
553 --
554 end delete_salary_survey;
555 --
556 end hr_salary_survey_api;