Addresses #130
git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3626 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -812,6 +812,7 @@ CREATE OR REPLACE PACKAGE BODY mip_parties AS
|
|||||||
p_contact_value IN VARCHAR2) IS
|
p_contact_value IN VARCHAR2) IS
|
||||||
l_current_come_id contact_mechanisms.id%TYPE;
|
l_current_come_id contact_mechanisms.id%TYPE;
|
||||||
l_current_come_value VARCHAR2(100);
|
l_current_come_value VARCHAR2(100);
|
||||||
|
l_contact_mechanism_exists BOOLEAN;
|
||||||
BEGIN
|
BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT vccm.come_id, vccm.Contact_value
|
SELECT vccm.come_id, vccm.Contact_value
|
||||||
@@ -819,21 +820,27 @@ CREATE OR REPLACE PACKAGE BODY mip_parties AS
|
|||||||
FROM v_current_contact_mechanisms vccm
|
FROM v_current_contact_mechanisms vccm
|
||||||
WHERE vccm.PRTY_ID = p_prty_id
|
WHERE vccm.PRTY_ID = p_prty_id
|
||||||
AND vccm.CODE = p_contact_mech_type;
|
AND vccm.CODE = p_contact_mech_type;
|
||||||
|
l_contact_mechanism_exists := TRUE;
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
WHEN no_data_found THEN --no current come exists, therefore just create one.
|
WHEN no_data_found THEN
|
||||||
create_party_contact_details(p_prty_id => p_prty_id,
|
l_contact_mechanism_exists := FALSE;
|
||||||
p_contact_mech_type => p_contact_mech_type,
|
|
||||||
p_contact_value => p_contact_value);
|
|
||||||
END;
|
END;
|
||||||
|
|
||||||
--check if it's a different value, if so, end this one and create a new one.
|
IF l_contact_mechanism_exists THEN
|
||||||
IF l_current_come_value = p_contact_value THEN
|
--check if it's a different value, if so, end this one and create a new one.
|
||||||
NULL; -- no change to store
|
IF l_current_come_value = p_contact_value THEN
|
||||||
ELSE
|
NULL; -- no change to store
|
||||||
UPDATE party_contact_mechanisms pcome
|
ELSE
|
||||||
SET pcome.end_date = SYSDATE
|
UPDATE party_contact_mechanisms pcome
|
||||||
WHERE pcome.come_id = l_current_come_id;
|
SET pcome.end_date = SYSDATE
|
||||||
|
WHERE pcome.come_id = l_current_come_id;
|
||||||
|
|
||||||
|
create_party_contact_details(p_prty_id => p_prty_id,
|
||||||
|
p_contact_mech_type => p_contact_mech_type,
|
||||||
|
p_contact_value => p_contact_value);
|
||||||
|
END IF;
|
||||||
|
ELSE
|
||||||
|
-- there is no previous contact mechanism value
|
||||||
create_party_contact_details(p_prty_id => p_prty_id,
|
create_party_contact_details(p_prty_id => p_prty_id,
|
||||||
p_contact_mech_type => p_contact_mech_type,
|
p_contact_mech_type => p_contact_mech_type,
|
||||||
p_contact_value => p_contact_value);
|
p_contact_value => p_contact_value);
|
||||||
|
|||||||
Reference in New Issue
Block a user