DBA Data[Home] [Help]

PACKAGE BODY: APPS.FA_PERSON

Source


1 PACKAGE BODY FA_PERSON as
2 /* $Header: fapkperb.pls 120.4 2009/08/05 14:39:34 bridgway ship $ */
3 
4 
5   PROCEDURE fa_predel_validation (p_person_id	number, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type default null)
6   IS
7   --
8   v_delete_permitted	varchar2(1);
9   --
10   BEGIN
11     --
12     hr_utility.set_location('FA_PERSON.FA_PREDEL_VALIDATION', 1);
13     --
14       begin
15 	select 'Y'
16 	into	v_delete_permitted
17 	from	dual
18 	where	not exists (
19 		select	'X'
20 		from	fa_massadd_distributions md
21 		where	md.employee_id = P_PERSON_ID);
22       exception
23  	when NO_DATA_FOUND then
24 		hr_utility.set_message (801, 'HR_6248_ALL_FA_PER_NO_DEL');
25 		hr_utility.raise_error;
26       end;
27       --
28       hr_utility.set_location('FA_PERSON.FA_PREDEL_VALIDATION', 2);
29       --
30       begin
31 	select 'Y'
32 	into	v_delete_permitted
33 	from	dual
34 	where	not exists (
35 		select	'X'
36 		from	fa_distribution_history	dh
37 		where	dh.assigned_to = P_PERSON_ID);
38       exception
39  	when NO_DATA_FOUND then
40 		hr_utility.set_message (801, 'HR_6269_ALL_FA2_PER_NO_DEL');
41 		hr_utility.raise_error;
42       end;
43       --
44       hr_utility.set_location('FA_PERSON.FA_PREDEL_VALIDATION', 3);
45       --
46       begin
47 	select 'Y'
48 	into	v_delete_permitted
49 	from	dual
50 	where	not exists (
51 		select	'X'
52 		from	fa_mass_transfers	mt
53 		where	mt.from_employee_id = P_PERSON_ID
54 		or	mt.to_employee_id = P_PERSON_ID);
55       exception
56  	when NO_DATA_FOUND then
57 		hr_utility.set_message (801, 'HR_6270_ALL_FA3_PER_NO_DEL');
58 		hr_utility.raise_error;
59       end;
60       --
61   END fa_predel_validation;
62 --
63 END FA_PERSON;