DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGS_EN_VAL_GATC

Source


1 PACKAGE BODY IGS_EN_VAL_GATC AS
2 /* $Header: IGSEN39B.pls 115.3 2002/11/28 23:58:45 nsidana ship $ */
3   --
4   -- Validate the update of a government aboriginal torres code record.
5   FUNCTION enrp_val_gatc_upd(
6   p_govt_aborig_torres_cd IN NUMBER ,
7   p_closed_ind IN VARCHAR2 DEFAULT 'N',
8   p_message_name OUT NOCOPY VARCHAR2)
9   RETURN BOOLEAN AS
10   BEGIN
11   DECLARE
12 
13   	v_aborig_torres_cd	IGS_PE_ABORG_TORESCD%ROWTYPE;
14   	CURSOR	c_aborig_torres_cd IS
15   		SELECT 	*
16   		FROM	IGS_PE_ABORG_TORESCD
17   		WHERE	govt_aborig_torres_cd = p_govt_aborig_torres_cd and
18   			closed_ind = 'N';
19   BEGIN
20   	-- Validate the update on a govt_aborig_torres_cd record.
21   	-- A IGS_PE_GOV_ABRGRESCD record cannot be closed if
22   	-- there are IGS_PE_LANGUAGE_CD records mapped to it that
23   	-- are still open
24   	IF (p_closed_ind = 'Y') THEN
25   		-- check if open IGS_PE_ABORG_TORESCD records exist
26   		OPEN  c_aborig_torres_cd;
27   		FETCH c_aborig_torres_cd INTO v_aborig_torres_cd;
28   		IF (c_aborig_torres_cd%FOUND) THEN
29   			CLOSE c_aborig_torres_cd;
30   			p_message_name := 'IGS_EN_CANT_CLOSE_GOV_ISL_CD';
31   			RETURN FALSE;
32   		END IF;
33   	END IF;
34   	p_message_name := null;
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_GATC.enrp_val_gatc_upd');
40 		IGS_GE_MSG_STACK.ADD;
41        	        App_Exception.Raise_Exception;
42 
43 
44   END;
45   END enrp_val_gatc_upd;
46 END IGS_EN_VAL_GATC;