DBA Data[Home] [Help]

PACKAGE BODY: APPS.FA_PERSON

Source


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