[Home] [Help]
PACKAGE BODY: APPS.IGS_EN_VAL_SP
Source
1 PACKAGE BODY IGS_EN_VAL_SP AS
2 /* $Header: IGSEN67B.pls 115.3 2002/11/29 00:07:23 nsidana ship $ */
3 --
4 -- To validate the delete of suburb postcode
5 FUNCTION enrp_val_sp_del(
6 p_postcode IN NUMBER ,
7 p_message_name OUT NOCOPY VARCHAR2)
8 RETURN BOOLEAN AS
9 BEGIN
10 DECLARE
11 v_person_id IGS_PE_PERSON.person_id%TYPE;
12 v_other_detail VARCHAR(255);
13 CURSOR gc_person_statistics(
14 cp_postcode IGS_PE_SUBURB_POSTCD.postcode%TYPE) IS
15 SELECT person_id
16 FROM IGS_PE_STATISTICS
17 WHERE NVL(term_location_postcode, 0) = cp_postcode OR
18 NVL(home_location_postcode, 0) = cp_postcode;
19 BEGIN
20 -- validate the deletion of IGS_PE_SUBURB_POSTCD record
21 p_message_name := null;
22 IF(p_postcode IS NULL) THEN
23 RETURN TRUE;
24 END IF;
25 OPEN gc_person_statistics(
26 p_postcode);
27 FETCH gc_person_statistics INTO v_person_id;
28 IF(gc_person_statistics%FOUND) THEN
29 CLOSE gc_person_statistics;
30 p_message_name := 'IGS_EN_NOTDEL_POSTCODE';
31 RETURN FALSE;
32 ELSE
33 CLOSE gc_person_statistics;
34 RETURN TRUE;
35 END IF;
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_SP.enrp_val_sp_del');
40 IGS_GE_MSG_STACK.ADD;
41 App_Exception.Raise_Exception;
42 END;
43 END enrp_val_sp_del;
44 END IGS_EN_VAL_SP;