27: ELSIF (p_table_name = 'HZ_FINANCIAL_REPORTS') THEN
28: return 'FIN_REPORT';
29: ELSIF (p_table_name = 'HZ_EMPLOYMENT_HISTORY') THEN
30: return 'EMP_HIST';
31: ELSIF (p_table_name = 'HZ_CUSTOMER_PROFILES') THEN
32: return 'CUST_PROFILE';
33: ELSE
34: return p_table_name;
35: END IF;
773:
774: CURSOR get_customer_profiles IS
775:
776: SELECT HZ_ACCOUNT_MERGE_DETAIL_OBJ(
777: get_object_type('HZ_CUSTOMER_PROFILES', from_profile_id),
778: operation,
779: NULL,
780: NULL,
781: from_profile_id,
789: )
790: FROM (SELECT 'Merge' operation, cpf.cust_account_profile_id from_profile_id,
791: cpt.cust_account_profile_id to_profile_id,
792: cmh.duplicate_id from_parent_id, cmh.customer_id to_parent_id
793: FROM ra_customer_merge_headers cmh, hz_customer_profiles_m cpf, hz_customer_profiles cpt
794: WHERE cmh.customer_merge_header_id = p_customer_merge_header_id
795: AND cmh.duplicate_id <> cmh.customer_id
796: AND cpf.cust_account_id = cmh.duplicate_id
797: AND cpf.customer_merge_header_id = p_customer_merge_header_id
805: cpf.cust_account_profile_id from_profile_id,
806: cpt.cust_account_profile_id to_profile_id,
807: cm.duplicate_site_id from_parent_id,
808: cm.customer_site_id to_parent_id
809: FROM ra_customer_merges cm, hz_customer_profiles_m cpf, hz_customer_profiles cpt
810: WHERE cm.customer_merge_header_id = p_customer_merge_header_id
811: AND cpf.customer_merge_header_id = p_customer_merge_header_id
812: AND cpf.cust_account_id = cm.duplicate_id
813: AND cpf.site_use_id = cm.duplicate_site_id
1128:
1129: FOR I IN 1..x_account_merge_v2_obj.customer_profile_objs.count LOOP
1130: l_site_use_id := null;
1131: SELECT site_use_id INTO l_site_use_id
1132: FROM hz_customer_profiles_m
1133: WHERE cust_account_profile_id = x_account_merge_v2_obj.customer_profile_objs(I).from_object_id;
1134:
1135: IF l_site_use_id IS NOT NULL THEN
1136: