1 PACKAGE BODY IGS_EN_VAL_CNC AS
2 /* $Header: IGSEN30B.pls 115.3 2002/11/28 23:56:31 nsidana ship $ */
3
4
5 --
6 -- Validate the country government country code.
7 FUNCTION enrp_val_cnc_govt(
8 p_govt_country_cd IN VARCHAR2 ,
9 p_message_name OUT NOCOPY VARCHAR2)
10 RETURN BOOLEAN AS
11 BEGIN
12 DECLARE
13 gv_other_detail VARCHAR(255);
14 gv_closed_ind IGS_PE_GOV_COUNTRYCD.closed_ind%TYPE;
15 CURSOR gc_govt_country_cd(
16 cp_govt_country_cd IGS_PE_GOV_COUNTRYCD.govt_country_cd%TYPE) IS
17 SELECT IGS_PE_GOV_COUNTRYCD.closed_ind
18 FROM IGS_PE_GOV_COUNTRYCD
19 WHERE IGS_PE_GOV_COUNTRYCD.govt_country_cd = cp_govt_country_cd;
20 BEGIN
21 -- This module validates if IGS_PE_GOV_COUNTRYCD.govt_country_cd
22 -- is closed
23 p_message_name := null;
24 OPEN gc_govt_country_cd(
25 p_govt_country_cd);
26 FETCH gc_govt_country_cd INTO gv_closed_ind;
27 IF (gc_govt_country_cd%FOUND) THEN
28 IF (gv_closed_ind = 'Y' ) THEN
29 CLOSE gc_govt_country_cd;
30 p_message_name := 'IGS_EN_GOV_COUNTRY_CD_CLOSED';
31 RETURN FALSE;
32 END IF;
33 END IF;
34 CLOSE gc_govt_country_cd;
35 RETURN TRUE;
36 EXCEPTION
37 WHEN OTHERS THEN
38 Fnd_Message.Set_Name('IGS','IGS_GE_UNHANDLED_EXP');
39 FND_MESSAGE.SET_TOKEN('NAME','IGS_EN_VAL_CNC.enrp_val_cnc_govt');
40 IGS_GE_MSG_STACK.ADD;
41 App_Exception.Raise_Exception;
42
43 END;
44 END enrp_val_cnc_govt;
45 --
46 -- To validate the delete of country code
47 FUNCTION enrp_val_cnc_del(
48 p_country_cd IN VARCHAR2 ,
49 p_message_name OUT NOCOPY VARCHAR2)
50 RETURN BOOLEAN AS
51 BEGIN
52 DECLARE
53 v_person_id IGS_PE_PERSON.person_id%TYPE;
54 v_other_detail VARCHAR(255);
55 CURSOR gc_person_statistics(
56 cp_country_cd IGS_PE_COUNTRY_CD.country_cd%TYPE) IS
57 SELECT person_id
58 FROM IGS_PE_STATISTICS
59 WHERE NVL(birth_country_cd, 'NULL') = cp_country_cd OR
60 NVL(term_location_country, 'NULL') = cp_country_cd OR
61 NVL(home_location_country, 'NULL') = cp_country_cd;
62 BEGIN
63 -- validate the deletion of IGS_PE_COUNTRY_CD record
64 p_message_name := null;
65 IF(p_country_cd IS NULL) THEN
66 RETURN TRUE;
67 END IF;
68 OPEN gc_person_statistics(
69 p_country_cd);
70 FETCH gc_person_statistics INTO v_person_id;
71 IF(gc_person_statistics%FOUND) THEN
72 CLOSE gc_person_statistics;
73 p_message_name := 'IGS_EN_NOTDEL_COUNTRY_CD';
74 RETURN FALSE;
75 ELSE
76 CLOSE gc_person_statistics;
77 RETURN TRUE;
78 END IF;
79 EXCEPTION
80 WHEN OTHERS THEN
81 Fnd_Message.Set_Name('IGS','IGS_GE_UNHANDLED_EXP');
82 FND_MESSAGE.SET_TOKEN('NAME','IGS_EN_VAL_CNC.enrp_val_cnc_del');
83 IGS_GE_MSG_STACK.ADD;
84 App_Exception.Raise_Exception;
85
86 END;
87 END enrp_val_cnc_del;
88 END IGS_EN_VAL_CNC;