[Home] [Help]
5715: DECLARE
5716: e_resource_busy EXCEPTION;
5717: PRAGMA EXCEPTION_INIT(e_resource_busy, -54);
5718: v_check VARCHAR2(1);
5719: v_max_expiry_dt IGS_PE_PERSENC_EFFCT.expiry_dt%TYPE;
5720: v_expiry_dt IGS_PE_PERSENC_EFFCT.expiry_dt%TYPE;
5721: CURSOR c_person_encumbrance_effect IS
5722: SELECT 'x'
5723: FROM IGS_PE_PERSENC_EFFCT
5716: e_resource_busy EXCEPTION;
5717: PRAGMA EXCEPTION_INIT(e_resource_busy, -54);
5718: v_check VARCHAR2(1);
5719: v_max_expiry_dt IGS_PE_PERSENC_EFFCT.expiry_dt%TYPE;
5720: v_expiry_dt IGS_PE_PERSENC_EFFCT.expiry_dt%TYPE;
5721: CURSOR c_person_encumbrance_effect IS
5722: SELECT 'x'
5723: FROM IGS_PE_PERSENC_EFFCT
5724: WHERE person_id = p_person_id AND
5719: v_max_expiry_dt IGS_PE_PERSENC_EFFCT.expiry_dt%TYPE;
5720: v_expiry_dt IGS_PE_PERSENC_EFFCT.expiry_dt%TYPE;
5721: CURSOR c_person_encumbrance_effect IS
5722: SELECT 'x'
5723: FROM IGS_PE_PERSENC_EFFCT
5724: WHERE person_id = p_person_id AND
5725: encumbrance_type = p_encumbrance_type AND
5726: pen_start_dt = p_pen_start_dt AND
5727: sequence_number <> p_sequence_number AND
5735: FOR UPDATE OF expiry_dt NOWAIT;
5736: v_pe_rec c_person_encumbrance%ROWTYPE;
5737: CURSOR c_expiry_dt IS
5738: SELECT MAX(pee.expiry_dt)
5739: FROM IGS_PE_PERSENC_EFFCT pee
5740: WHERE pee.person_id = p_person_id AND
5741: pee.encumbrance_type = p_encumbrance_type AND
5742: pee.pen_start_dt = p_pen_start_dt AND
5743: pee.sequence_number <> p_sequence_number;
5752: p_expiry_dt IS NULL) THEN
5753: -- RETURN TRUE;
5754: RETURN;
5755: END IF;
5756: -- Check for any open IGS_PE_PERSENC_EFFCT
5757: OPEN c_person_encumbrance_effect;
5758: FETCH c_person_encumbrance_effect INTO v_check;
5759: IF (c_person_encumbrance_effect%NOTFOUND) THEN
5760: -- get the latest expiry dt of any
5757: OPEN c_person_encumbrance_effect;
5758: FETCH c_person_encumbrance_effect INTO v_check;
5759: IF (c_person_encumbrance_effect%NOTFOUND) THEN
5760: -- get the latest expiry dt of any
5761: -- IGS_PE_PERSENC_EFFCT record
5762: OPEN c_expiry_dt;
5763: FETCH c_expiry_dt INTO v_max_expiry_dt;
5764: -- set the value of expiry_dt to be used
5765: -- in the update below