[Home] [Help]
PACKAGE BODY: APPS.RCV_PERSON
Source
1 PACKAGE BODY rcv_person AS
2 /* $Header: rvpredeb.pls 115.0 99/07/17 02:31:02 porting ship $ */
3
4 --
5 /*
6 NAME
7 rcv_predel_validation
8 DESCRIPTION
9 Foreign key reference check.
10 */
11 --
12 PROCEDURE rcv_predel_validation (p_person_id number)
13 IS
14 --
15 v_delete_permitted varchar2(1);
16 --
17 BEGIN
18 --
19 hr_utility.set_location('RCV_PERSON.RCV_PREDEL_VALIDATION', 18);
20 --
21 begin
22 select 'Y'
23 into v_delete_permitted
24 from sys.dual
25 where not exists (
26 select null
27 from rcv_shipment_headers rcv
28 where rcv.employee_id = P_PERSON_ID);
29 exception
30 when NO_DATA_FOUND then
31 hr_utility.set_message (801, 'HR_6575_ALL_PO24_PER_NO_DEL');
32 hr_utility.raise_error;
33 end;
34 --
35 hr_utility.set_location('RCV_PERSON.RCV_PREDEL_VALIDATION', 19);
36 --
37 begin
38 select 'Y'
39 into v_delete_permitted
40 from sys.dual
41 where not exists (
42 select null
43 from rcv_shipment_lines rcv
44 where rcv.employee_id = P_PERSON_ID
45 or rcv.deliver_to_person_id = P_PERSON_ID);
46 exception
47 when NO_DATA_FOUND then
48 hr_utility.set_message (801, 'HR_6581_ALL_PO25_PER_NO_DEL');
49 hr_utility.raise_error;
50 end;
51 --
52 hr_utility.set_location('RCV_PERSON.RCV_PREDEL_VALIDATION', 20);
53 --
54 begin
55 select 'Y'
56 into v_delete_permitted
57 from sys.dual
58 where not exists (
59 select null
60 from rcv_transactions rcv
61 where rcv.employee_id = P_PERSON_ID
62 or rcv.deliver_to_person_id = P_PERSON_ID)
63 and not exists (
64 select null
65 from rcv_transactions_interface rcv
66 where rcv.employee_id = P_PERSON_ID
67 or rcv.deliver_to_person_id = P_PERSON_ID);
68 exception
69 when NO_DATA_FOUND then
70 hr_utility.set_message (801, 'HR_6582_ALL_PO26_PER_NO_DEL');
71 hr_utility.raise_error;
72 end;
73 --
74 END rcv_predel_validation;
75 --
76 END rcv_person;