DBA Data[Home] [Help]

APPS.HZ_IMP_DQM_STAGE SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 101

    CURSOR c1 is    select 'Y'
         from hz_match_rule_primary a
         where match_rule_id = p_match_rule_id
         and a.attribute_id in (
             select attribute_id
             from hz_trans_attributes_b
             where entity_name = p_et_name
             and attribute_name = p_attr_name)
         union
             select 'Y'
             from hz_match_rule_secondary a
             where match_rule_id = p_match_rule_id
             and a.attribute_id in (
                 select attribute_id
                 from hz_trans_attributes_b
                 where entity_name = p_et_name
                 and attribute_name = p_attr_name);
Line: 140

    select original_system into l_os from hz_imp_batch_summary where batch_id = p_batch_id;
Line: 212

   select batch_dedup_flag, batch_dedup_match_rule_id, registry_dedup_match_rule_id, addr_val_flag
   into l_a, l_c, l_d, l_e
   from hz_imp_batch_summary
   where batch_id = p_batch_id;
Line: 235

                log( ' Update party_sites since address validation was not run');
Line: 237

                update HZ_SRCH_PSITES c set party_site_id = ( select b.party_site_id
                from hz_imp_addresses_int a, HZ_IMP_ADDRESSES_SG b
                where a.rowid = b.int_row_id
                and c.int_row_id = a.rowid
                and a.batch_id = p_batch_id
                and a.batch_id = c.batch_id
                and b.action_flag = 'I'  ),
                party_id = ( select b.party_id
                from hz_imp_addresses_int a, HZ_IMP_ADDRESSES_SG b
                where a.rowid = b.int_row_id
                and c.int_row_id = a.rowid
                and a.batch_id = p_batch_id
                and a.batch_id = c.batch_id
                and b.action_flag = 'I'
                ) where batch_id = p_batch_id;
Line: 254

             log( ' Update party as same match rule being used');
Line: 255

             update hz_srch_parties c set party_id = ( select b.party_id
             from hz_imp_parties_int a, hz_imp_parties_sg b
             where a.rowid = b.int_row_id
             and c.int_row_id = a.rowid
             and a.batch_id = p_batch_id
             and a.batch_id = c.batch_id
             and b.action_flag = 'I' );
Line: 262

             log( ' Update contacts as same match rule being used');
Line: 263

             update HZ_SRCH_CONTACTS c set party_id = ( select b.sub_id
             from HZ_IMP_CONTACTS_INT a, HZ_IMP_CONTACTS_SG b
             where a.rowid = b.int_row_id
             and c.int_row_id = a.rowid
             and a.batch_id = p_batch_id
             and a.batch_id = c.batch_id
             and b.action_flag = 'I' ),
             org_contact_id = (select b.contact_id
             from HZ_IMP_CONTACTS_INT a, HZ_IMP_CONTACTS_SG b
             where a.rowid = b.int_row_id
             and a.batch_id = p_batch_id
             and a.batch_id = c.batch_id
             and b.action_flag = 'I' );
Line: 276

             log( ' Update contact_points as same match rule being used');
Line: 277

             update HZ_SRCH_CPTS c set party_id = ( select b.party_id
             from HZ_IMP_CONTACTPTS_INT a, HZ_IMP_CONTACTPTS_SG b
             where a.rowid = b.int_row_id
             and c.int_row_id = a.rowid
             and a.batch_id = p_batch_id
             and a.batch_id = c.batch_id
             and b.action_flag = 'I' ),
             party_site_id = ( select b.party_site_id
             from HZ_IMP_CONTACTPTS_INT a, HZ_IMP_CONTACTPTS_SG b
             where a.rowid = b.int_row_id
             and c.int_row_id = a.rowid
             and a.batch_id = p_batch_id
             and a.batch_id = c.batch_id
             and b.action_flag = 'I' ),
             contact_point_id = ( select b.contact_point_id
             from HZ_IMP_CONTACTPTS_INT a, HZ_IMP_CONTACTPTS_SG b
             where a.rowid = b.int_row_id
             and c.int_row_id = a.rowid
             and a.batch_id = p_batch_id
             and a.batch_id = c.batch_id
             and b.action_flag = 'I' );
Line: 337

  l_sql := 'select ' || proc ||
           '(:attrval,:lang,:attr,:entity,:ctx) from dual';
Line: 363

    l_sql_stmt := ' select /*+ INDEX(a) */ count(batch_id) from ' || p_table_name || ' a where batch_id <> :1 and rownum < 2 ';
Line: 386

    l_sql_stmt :=  ' delete from ' ||  p_table_name || ' where batch_id = :1 ' ;
Line: 432

    delete from HZ_INT_DUP_RESULTS where batch_id = p_batch_id;
Line: 452

    l_sql_stmt := ' delete from ' ||l_owner || '.' || p_table_name || ' where batch_id = :1 ';
Line: 474

    delete from HZ_IMP_INT_DEDUP_RESULTS where batch_id = p_batch_id;
Line: 475

    delete from HZ_IMP_DUP_PARTIES where batch_id = p_batch_id;
Line: 476

    delete from HZ_IMP_DUP_DETAILS where batch_id = p_batch_id;
Line: 499

         select owner into l_owner from sys.all_objects
         where object_name = p_object_name  and OBJECT_TYPE =  p_object_type and owner = l_owner1;
Line: 515

        delete from hz_srch_psites a
        where a.party_os || a.party_osr in (
        select a.party_os || a.party_osr
        from HZ_IMP_ADDRESSES_SG b
        where a.party_os = b.party_orig_system
        and a.party_osr = b.party_orig_system_reference
        and b.action_flag = 'U'
        and a.batch_id = p_batch_id);
Line: 524

        delete from HZ_SRCH_CONTACTS c where c.contact_os ||c.contact_osr || c.batch_id in(
        select b.contact_orig_system || b.contact_orig_system_reference || b.batch_id
        from HZ_IMP_CONTACTS_SG a, HZ_IMP_CONTACTS_INT b
        where a.int_row_id = b.rowid
        and a.action_flag = 'U'
        and b.contact_orig_system = c.contact_os
        and b.contact_orig_system_reference = c.contact_osr
         and b.batch_id = p_batch_id);
Line: 533

        delete from HZ_SRCH_CPTS a
        where a.party_os || a.party_osr in (
        select a.party_os || a.party_osr
        from HZ_IMP_CONTACTPTS_SG b
        where a.party_os = b.party_orig_system
        and a.party_osr = b.party_orig_system_reference
        and b.action_flag = 'U'
        and a.batch_id = p_batch_id);
Line: 573

    select batch_dedup_flag, registry_dedup_flag, batch_dedup_match_rule_id, registry_dedup_match_rule_id, addr_val_flag
    into l_a, l_b, l_c, l_d, l_e
    from hz_imp_batch_summary
    where batch_id = p_batch_id;
Line: 583

                    /*select owner into l_owner from sys.all_objects
                    where object_name = 'HZ_SRCH_PSITES' and OBJECT_TYPE = 'TABLE' and owner = l_owner1 ;*/
Line: 586

                    l_sqlstr := 'select owner from sys.all_tables
                    where table_name = ''HZ_SRCH_PSITES'' and owner = :p_owner ';
Line: 654

            UPDATE hz_imp_work_units SET BATCH_DEDUP_STATUS = 'P', BATCH_DEDUP_STAGE = 1
            WHERE batch_id = p_batch_id and BATCH_DEDUP_STATUS is null and rownum = 1
            RETURNING rowid, FROM_ORIG_SYSTEM_REF, TO_ORIG_SYSTEM_REF into l_row_id, l_from_osr, l_to_osr;
Line: 674

                UPDATE hz_imp_work_units SET BATCH_DEDUP_STATUS = 'E' where rowid = l_row_id;
Line: 677

                UPDATE hz_imp_work_units SET BATCH_DEDUP_STATUS = 'C' where rowid = l_row_id;
Line: 681

            UPDATE hz_imp_work_units SET BATCH_DEDUP_STATUS = 'P', BATCH_DEDUP_STAGE = 2
            WHERE batch_id = p_batch_id AND BATCH_DEDUP_STAGE = 1 and ROWNUM = 1
            RETURNING rowid, FROM_ORIG_SYSTEM_REF, TO_ORIG_SYSTEM_REF into l_row_id, l_from_osr, l_to_osr;
Line: 693

                UPDATE hz_imp_work_units SET BATCH_DEDUP_STATUS = 'E' WHERE ROWID = l_row_id;
Line: 696

                UPDATE hz_imp_work_units SET BATCH_DEDUP_STATUS = 'C' WHERE ROWID = l_row_id;
Line: 760

        UPDATE HZ_IMP_BATCH_SUMMARY set BATCH_DEDUP_STATUS = 'PROCESSING' where batch_id = p_batch_id;
Line: 788

          select request_id BULK COLLECT into l_sub_requests
          from fnd_concurrent_requests R
          where parent_request_id = FND_GLOBAL.conc_request_id
          and (phase_code<>'C' or status_code<>'C');
Line: 827

          select request_id BULK COLLECT into l_sub_requests
          from fnd_concurrent_requests R
          where parent_request_id = FND_GLOBAL.conc_request_id
          and (phase_code<>'C' or status_code<>'C');
Line: 847

            UPDATE HZ_IMP_BATCH_SUMMARY set BATCH_DEDUP_STATUS = 'COMPLETED' where batch_id = p_batch_id;
Line: 855

        UPDATE HZ_IMP_BATCH_SUMMARY set BATCH_DEDUP_STATUS = 'ERROR' where batch_id = p_batch_id;
Line: 945

PROCEDURE get_select_str(
    p_entity_name       IN VARCHAR2,
    p_rule_id     IN NUMBER,
    p_sql_str IN OUT NOCOPY VARCHAR2,
    p_et_point IN VARCHAR2,
    p_std_chk IN NUMBER
) IS
 is_first BOOLEAN := TRUE;
Line: 953

 l_procedure_name VARCHAR2(30) := '.GET_SELECT_STR' ;
Line: 963

    FOR TX IN (select attribute_name
                from hz_trans_attributes_b
                where entity_name = p_entity_name
                and HZ_IMP_DQM_STAGE.EXIST_COL(attribute_name, p_entity_name) = 'Y'
                and custom_attribute_procedure is null
/*                and attribute_name not in
                ('SIC_CODE', 'SIC_CODE_TYPE', 'TAX_NAME', 'CATEGORY_CODE', 'IDENTIFYING_ADDRESS_FLAG', 'STATUS', 'PRIMARY_FLAG', 'REFERENCE_USE_FLAG' ) */
                and attribute_id in ( select attribute_id
                    from hz_match_rule_primary
                    where match_rule_id = p_rule_id
                    union
                    select attribute_id
                    from hz_match_rule_secondary
                    where match_rule_id = p_rule_id)
                    ) LOOP
        IF is_first THEN
            is_first := false;
Line: 981

                p_sql_str :=  '  select ' || chk_is_std(TX.attribute_name)  ;
Line: 984

                   p_sql_str :=  '  select decode(a.party_type, ''ORGANIZATION'', a.organization_name, ''PERSON'', a.person_first_name || '' '' || a.person_last_name) as PARTY_NAME ';
Line: 986

                   p_sql_str :=  '  select a.' || TX.attribute_name ;
Line: 1008

              p_sql_str :=  'select a.party_orig_system';
Line: 1035

              p_sql_str := 'select a.party_orig_system, a.party_orig_system_reference, a.cp_orig_system, a.cp_orig_system_reference, a.site_orig_system';
Line: 1046

                  p_sql_str :=  'select a.obj_orig_system, a.obj_orig_system_reference, a.contact_orig_system, a.contact_orig_system_reference, b.party_action_flag, a.rowid, b.obj_id';
Line: 1061

              p_sql_str := 'select a.party_orig_system';
Line: 1073

                   p_sql_str := 'select a.party_orig_system, a.party_orig_system_reference, a.cp_orig_system, a.cp_orig_system_reference, a.site_orig_system, a.site_orig_system_reference, a.rowid, a.contact_point_type';
Line: 1082

                 p_sql_str := 'select a.obj_orig_system, a.obj_orig_system_reference, a.contact_orig_system, a.contact_orig_system_reference, a.rowid';
Line: 1098

END get_select_str;
Line: 1115

      FOR TX IN ( select attribute_id || 'E' as STAGED_ATTRIBUTE_COLUMN
            from hz_trans_attributes_b
            where attribute_id in (select attribute_id
            from hz_match_rule_primary
            where match_rule_id = p_rule_id
            union
            select attribute_id
            from hz_match_rule_secondary
            where match_rule_id = p_rule_id)
            and entity_name = p_entity_name
            and HZ_IMP_DQM_STAGE.EXIST_COL(attribute_name, p_entity_name) = 'Y'
            and custom_attribute_procedure is null
/*            and attribute_name not in
            ('SIC_CODE', 'SIC_CODE_TYPE', 'TAX_NAME', 'CATEGORY_CODE', 'IDENTIFYING_ADDRESS_FLAG', 'STATUS', 'PRIMARY_FLAG', 'REFERENCE_USE_FLAG' ) */
            ) LOOP
            IF is_first THEN
               is_first := false;
Line: 1223

PROCEDURE get_cust_insert_str (
    p_entity_name       IN VARCHAR2,
    p_match_rule_id     IN NUMBER,
    p_sql_str IN OUT NOCOPY VARCHAR2,
    p_et_point IN VARCHAR2,
    p_attr_name IN VARCHAR2,
    p_purpose VARCHAR2 -- can be taken out
) IS
 is_first BOOLEAN := TRUE;
Line: 1233

 l_procedure_name VARCHAR2(30) := '.GET_CUST_INSERT_STR' ;
Line: 1240

      FOR TX IN (  select STAGED_ATTRIBUTE_COLUMN
            from hz_trans_functions_b
            where attribute_id in (select attribute_id
            from hz_trans_attributes_b
            where attribute_name = p_attr_name
            and entity_name = p_entity_name)
            and function_id in (select function_id
            from hz_match_rule_primary e, hz_primary_trans d
            where match_rule_id = p_match_rule_id
            and e.PRIMARY_ATTRIBUTE_ID = d.PRIMARY_ATTRIBUTE_ID
            union
            select function_id
            from hz_match_rule_secondary g, hz_secondary_trans f
            where f.SECONDARY_ATTRIBUTE_ID = g.SECONDARY_ATTRIBUTE_ID
            and match_rule_id = p_match_rule_id)
            order by STAGED_ATTRIBUTE_COLUMN
            ) LOOP
            IF is_first THEN
               is_first := false;
Line: 1264

END get_cust_insert_str;
Line: 1267

PROCEDURE get_insert_str (
    p_entity_name       IN VARCHAR2,
    p_rule_id     IN NUMBER,
    p_sql_str IN OUT NOCOPY VARCHAR2,
    p_et_point IN VARCHAR2
) IS
 is_first BOOLEAN := TRUE;
Line: 1275

 l_procedure_name VARCHAR2(30) := '.GET_INSERT_STR' ;
Line: 1283

      FOR TX IN ( select STAGED_ATTRIBUTE_COLUMN
            from hz_trans_functions_b
            where function_id in
		     (select function_id
                     from hz_match_rule_primary e, hz_primary_trans d
                     where match_rule_id = p_rule_id
                     and e.PRIMARY_ATTRIBUTE_ID = d.PRIMARY_ATTRIBUTE_ID
                     union
                     select function_id
                     from hz_match_rule_secondary g, hz_secondary_trans f
                     where f.SECONDARY_ATTRIBUTE_ID = g.SECONDARY_ATTRIBUTE_ID
                     and match_rule_id = p_rule_id)
            and nvl(active_flag, 'Y') <> 'N'
            and staged_attribute_table = p_entity_name
            and attribute_id not in (
                   select attribute_id
                    from hz_trans_attributes_b
                    where  custom_attribute_procedure is not  null
                    or HZ_IMP_DQM_STAGE.EXIST_COL(attribute_name, p_entity_name) = 'N'
/*                    or  attribute_name in
                    ('SIC_CODE', 'SIC_CODE_TYPE', 'TAX_NAME', 'CATEGORY_CODE', 'IDENTIFYING_ADDRESS_FLAG', 'STATUS', 'PRIMARY_FLAG', 'REFERENCE_USE_FLAG' ) */
                    ) order by STAGED_ATTRIBUTE_COLUMN
            ) LOOP
            IF is_first THEN
               is_first := false;
Line: 1329

                get_cust_insert_str ('PARTY_SITES', p_rule_id, l_sql_str, 'PS', 'ADDRESS', null);
Line: 1341

                get_cust_insert_str ('CONTACT_POINTS', p_rule_id, l_sql_str, 'CP', 'RAW_PHONE_NUMBER', null);
Line: 1353

                get_cust_insert_str ('CONTACTS', p_rule_id, l_sql_str, NULL, 'CONTACT_NAME', null);
Line: 1377

                get_cust_insert_str ('PARTY_SITES', p_rule_id, l_sql_str, 'PS', 'ADDRESS', null);
Line: 1389

                get_cust_insert_str ('CONTACT_POINTS', p_rule_id, l_sql_str, 'CP', 'RAW_PHONE_NUMBER', null);
Line: 1401

                get_cust_insert_str ('CONTACTS', p_rule_id, l_sql_str, NULL, 'CONTACT_NAME', null);
Line: 1417

END get_insert_str;
Line: 1419

PROCEDURE get_cust_insert_val_str (
    p_entity_name       IN VARCHAR2,
    p_rule_id     IN NUMBER,
    p_sql_str IN OUT NOCOPY VARCHAR2,
    p_et_point IN VARCHAR2,
    p_attr_name IN VARCHAR2
) IS
 is_first BOOLEAN := TRUE;
Line: 1428

 l_procedure_name VARCHAR2(30) := '.GET_CUST_INSERT_VAL_STR' ;
Line: 1435

      FOR TX IN ( select STAGED_ATTRIBUTE_COLUMN
            from hz_trans_functions_b
            where attribute_id in (select attribute_id
            from hz_trans_attributes_b
            where attribute_name = p_attr_name
            and entity_name = p_entity_name)
            and function_id in (select function_id
            from hz_match_rule_primary e, hz_primary_trans d
            where match_rule_id = p_rule_id
            and e.PRIMARY_ATTRIBUTE_ID = d.PRIMARY_ATTRIBUTE_ID
            union
            select function_id
            from hz_match_rule_secondary g, hz_secondary_trans f
            where f.SECONDARY_ATTRIBUTE_ID = g.SECONDARY_ATTRIBUTE_ID
            and match_rule_id = p_rule_id)
            order by STAGED_ATTRIBUTE_COLUMN
            ) LOOP
            IF is_first THEN
               is_first := false;
Line: 1459

END   get_cust_insert_val_str;
Line: 1461

PROCEDURE get_insert_val_str (
    p_entity_name       IN VARCHAR2,
    p_rule_id     IN NUMBER,
    p_sql_str IN OUT NOCOPY VARCHAR2,
    p_et_point IN VARCHAR2
) IS
 is_first BOOLEAN := TRUE;
Line: 1469

 l_procedure_name VARCHAR2(30) := '.GET_INSERT_VAL_STR' ;
Line: 1477

      FOR TX IN ( select STAGED_ATTRIBUTE_COLUMN
            from hz_trans_functions_b
            where function_id in (select function_id
            from hz_match_rule_primary e, hz_primary_trans d
            where e.PRIMARY_ATTRIBUTE_ID = d.PRIMARY_ATTRIBUTE_ID
            and match_rule_id = p_rule_id
            union
            select function_id
            from hz_match_rule_secondary g, hz_secondary_trans f
            where f.SECONDARY_ATTRIBUTE_ID = g.SECONDARY_ATTRIBUTE_ID
            and match_rule_id = p_rule_id)
            and nvl(active_flag, 'Y') <> 'N'
            and staged_attribute_table = p_entity_name
            and attribute_id not in (
                    select attribute_id
                    from hz_trans_attributes_b
                    where  custom_attribute_procedure is not  null
                    or HZ_IMP_DQM_STAGE.EXIST_COL(attribute_name, p_entity_name) = 'N'

            ) order by STAGED_ATTRIBUTE_COLUMN
            ) LOOP
            IF is_first THEN
               is_first := false;
Line: 1521

                get_cust_insert_val_str ('PARTY_SITES', p_rule_id, l_sql_str, 'PS', 'ADDRESS');
Line: 1535

                get_cust_insert_val_str ('CONTACT_POINTS', p_rule_id, l_sql_str, 'CP', 'RAW_PHONE_NUMBER');
Line: 1547

                get_cust_insert_val_str ('CONTACTS', p_rule_id, l_sql_str, 'CT', 'CONTACT_NAME');
Line: 1571

                get_cust_insert_val_str ('PARTY_SITES', p_rule_id, l_sql_str, 'PS', 'ADDRESS');
Line: 1585

                get_cust_insert_val_str ('CONTACT_POINTS', p_rule_id, l_sql_str, 'CP', 'RAW_PHONE_NUMBER');
Line: 1597

                get_cust_insert_val_str ('CONTACTS', p_rule_id, l_sql_str, 'CT', 'CONTACT_NAME');
Line: 1613

END get_insert_val_str;
Line: 1621

     CURSOR c1 is    select 'Y'
     from hz_match_rule_primary a, hz_match_rule_secondary b
     where a.match_rule_id = b.match_rule_id
     and a.match_rule_id = p_rule_id
     -- check if one really needs the below condition
--     and a.attribute_id = b.attribute_id
         and a.attribute_id in (
     select attribute_id
     from hz_trans_attributes_b
      where entity_name = 'PARTY_SITES'
     and attribute_name = 'ADDRESS');
Line: 1654

     CURSOR c1 is    select 'Y'
     from hz_match_rule_primary a, hz_match_rule_secondary b
     where a.match_rule_id = b.match_rule_id
     and a.match_rule_id = p_rule_id
     -- check if one really needs the below condition
--     and a.attribute_id = b.attribute_id
         and a.attribute_id in (
     select attribute_id
     from hz_trans_attributes_b
      where entity_name = 'CONTACT_POINTS'
     and attribute_name = 'RAW_PHONE_NUMBER');
Line: 1687

     CURSOR c1 is    select 'Y'
     from hz_match_rule_primary a, hz_match_rule_secondary b
     where a.match_rule_id = b.match_rule_id
     and a.match_rule_id = p_rule_id
     -- check if one really needs the below condition
--     and a.attribute_id = b.attribute_id
         and a.attribute_id in (
     select attribute_id
     from hz_trans_attributes_b
     where entity_name = 'CONTACTS'
     and attribute_name = 'CONTACT_NAME' );
Line: 1719

     CURSOR c1 is    select 'Y'
     from hz_match_rule_primary a, hz_match_rule_secondary b
     where a.match_rule_id = b.match_rule_id
     and a.match_rule_id = p_rule_id
     and a.attribute_id = b.attribute_id
         and a.attribute_id in (
     select attribute_id
     from hz_trans_attributes_b
     where entity_name = 'CONTACTS'
     and attribute_name = 'CONTACT_NAME' );
Line: 1754

         select ATTRIBUTE_NAME, USER_DEFINED_ATTRIBUTE_NAME, PROCEDURE_NAME, STAGED_ATTRIBUTE_COLUMN, b.attribute_id
            from hz_trans_functions_b b, hz_trans_attributes_vl c
            where b.attribute_id = c.attribute_id
            --Fix for bug 4669257. Removing the hardcoded reference below.
            --and userenv('LANG') = 'US'
            and b.function_id in (select function_id
            from hz_match_rule_primary d, hz_primary_trans e
            where match_rule_id = p_rule_id
            and d.primary_attribute_id = e.primary_attribute_id
            union
            select function_id
            from hz_match_rule_secondary f, hz_secondary_trans g
            where f.SECONDARY_ATTRIBUTE_ID = g.SECONDARY_ATTRIBUTE_ID -- b.attribute_id = c.attribute_id
            and match_rule_id = p_rule_id)
            and nvl(active_flag, 'Y') <> 'N'
            and entity_name = p_et_name
            and attribute_name = p_attr_name;
Line: 1802

 	         select STAGED_ATTRIBUTE_COLUMN, b.attribute_id
             from hz_trans_functions_b b, hz_trans_attributes_vl c
             where b.attribute_id = c.attribute_id
             --Fix for bug 4669257. Removing the hardcoded reference below.
             --and userenv('LANG') = 'US'
             and b.function_id in
                  (select function_id
                   from hz_match_rule_primary d, hz_primary_trans e
                   where match_rule_id = p_rule_id
                   and d.primary_attribute_id = e.primary_attribute_id
                   union
                   select function_id
                   from hz_match_rule_secondary f, hz_secondary_trans g
                   where f.SECONDARY_ATTRIBUTE_ID = g.SECONDARY_ATTRIBUTE_ID -- b.attribute_id = c.attribute_id
                   and match_rule_id = p_rule_id)
             and nvl(active_flag, 'Y') <> 'N'
             and entity_name = p_entity_name
             and custom_attribute_procedure is null
             and HZ_IMP_DQM_STAGE.EXIST_COL(attribute_name, p_entity_name) = 'Y'
             order by STAGED_ATTRIBUTE_COLUMN
             ) LOOP
                -- DO THIS IF AND ONLY IF THIS ATTRIBUTE IS A CONDITION ATTRIBUTE
	        IF HZ_WORD_CONDITIONS_PKG.is_a_cond_attrib( TX.ATTRIBUTE_ID)
     		THEN
             		-- ONE TIME ONLY
             		IF NONE
             		THEN
             			l_trans_list(i) := '----------- SETTING GLOBAL CONDITION RECORD AT THE ' || p_entity_name || ' LEVEL ---------';
Line: 1847

      FOR TX IN ( select ATTRIBUTE_NAME, USER_DEFINED_ATTRIBUTE_NAME, PROCEDURE_NAME, STAGED_ATTRIBUTE_COLUMN, b.attribute_id
            from hz_trans_functions_b b, hz_trans_attributes_vl c
            where b.attribute_id = c.attribute_id
            --Fix for bug 4669257. Removing the hardcoded reference below.
            --and userenv('LANG') = 'US'
            and b.function_id in
                 (select function_id
                  from hz_match_rule_primary d, hz_primary_trans e
                  where match_rule_id = p_rule_id
                  and d.primary_attribute_id = e.primary_attribute_id
                  union
                  select function_id
                  from hz_match_rule_secondary f, hz_secondary_trans g
                  where f.SECONDARY_ATTRIBUTE_ID = g.SECONDARY_ATTRIBUTE_ID -- b.attribute_id = c.attribute_id
                  and match_rule_id = p_rule_id)
            and nvl(active_flag, 'Y') <> 'N'
            and entity_name = p_entity_name
            and custom_attribute_procedure is null
            and HZ_IMP_DQM_STAGE.EXIST_COL(attribute_name, p_entity_name) = 'Y'
--            and attribute_name not in
--           ('SIC_CODE', 'SIC_CODE_TYPE', 'TAX_NAME', 'CATEGORY_CODE', 'IDENTIFYING_ADDRESS_FLAG', 'STATUS', 'PRIMARY_FLAG', 'REFERENCE_USE_FLAG' )

            order by STAGED_ATTRIBUTE_COLUMN
            ) LOOP

            IF has_trx_context(TX.PROCEDURE_NAME) THEN
                    l_str := '        H_' || TX.STAGED_ATTRIBUTE_COLUMN || '(I) := ' || TX.PROCEDURE_NAME || '(H_' || TX.ATTRIBUTE_ID || 'E(I), NULL, '''|| TX.ATTRIBUTE_NAME || ''', '''|| p_entity_name || ''', ''SEARCH'' );' ;
Line: 1978

  get_select_str('PARTY', p_rule_id, l_sel_str, 'INT_INT',null);
Line: 2028

    l_trans_list.DELETE(I);
Line: 2039

  l('        INSERT INTO HZ_SRCH_PARTIES (');
Line: 2040

  get_insert_str('HZ_STAGED_PARTIES', p_rule_id, l_sel_str, 'INT_INT');
Line: 2056

  get_insert_val_str('HZ_STAGED_PARTIES', p_rule_id, l_sel_str, 'INT_INT');
Line: 2125

  get_select_str('PARTY', p_rule_id, l_sel_str, 'INT_TCA', NULL);
Line: 2133

/*            select a.organization_name, a.duns_number_c, a.tax_reference,
                    a.party_orig_system, a.party_orig_system_reference
                    */
l('    		from hz_imp_parties_int a  ');
Line: 2174

    l_trans_list.DELETE(I);
Line: 2184

l('        INSERT INTO HZ_SRCH_PARTIES ( ');
Line: 2185

  get_insert_str('HZ_STAGED_PARTIES', p_rule_id, l_sel_str, 'INT_TCA');
Line: 2199

  get_insert_val_str('HZ_STAGED_PARTIES', p_rule_id, l_sel_str, 'INT_TCA');
Line: 2264

  get_select_str('PARTY_SITES', p_rule_id, l_sel_str, 'INT_INT', DO_STD_CHK);
Line: 2272

            select  a.party_orig_system, a.party_orig_system_reference,
                a.site_orig_system, a.site_orig_system_reference,
                b.party_id, b.party_site_id, a.address1, a.postal_code
                */
l('            from hz_imp_addresses_int a, hz_imp_addresses_sg b ');
Line: 2289

  get_select_str('PARTY_SITES', p_rule_id, l_sel_str, 'INT_INT', DO_STD_CHK);
Line: 2291

dbms_output.put_line('select_str (PARTY_SITES) = ' || l_sel_str);
Line: 2344

    l_trans_list.DELETE(I);
Line: 2354

l('        INSERT INTO HZ_SRCH_PSITES ( ');
Line: 2355

  get_insert_str('HZ_STAGED_PARTY_SITES', p_rule_id, l_sel_str, 'INT_INT');
Line: 2373

  get_insert_val_str('HZ_STAGED_PARTY_SITES', p_rule_id, l_sel_str, 'INT_INT');
Line: 2444

  get_select_str('PARTY_SITES', p_rule_id, l_sel_str, 'INT_TCA', null);
Line: 2452

/*            select  a.party_orig_system, a.party_orig_system_reference,
                a.site_orig_system, a.site_orig_system_reference,
                  a.address1, a.postal_code */
l('             from hz_imp_addresses_int a ');
Line: 2493

    l_trans_list.DELETE(I);
Line: 2504

l('         INSERT INTO HZ_SRCH_PSITES ( ');
Line: 2505

  get_insert_str('HZ_STAGED_PARTY_SITES', p_rule_id, l_sel_str, 'INT_TCA');
Line: 2521

  get_insert_val_str('HZ_STAGED_PARTY_SITES', p_rule_id, l_sel_str, 'INT_TCA');
Line: 2614

  l('   select batch_dedup_flag, registry_dedup_flag, batch_dedup_match_rule_id, registry_dedup_match_rule_id, addr_val_flag  ');
Line: 2664

  l('      CURSOR c1 is    select ''Y'' ');
Line: 2670

  l('      select attribute_id ');
Line: 2674

  l('      select attribute_id ');
Line: 2691

  get_select_str('CONTACTS', p_rule_id, l_sel_str, 'INT_INT', NULL);
Line: 2700

/*  l('             select a.sub_orig_system, a.sub_orig_system_reference, ');
Line: 2719

  get_select_str('CONTACTS', p_rule_id, l_sel_str, 'INT_INT', NULL);
Line: 2727

/*  l('                 select  a.sub_orig_system, a.sub_orig_system_reference, ');
Line: 2747

  get_select_str('CONTACTS', p_rule_id, l_sel_str, 'INT_INT', NULL);
Line: 2755

/*  l('             select a.sub_orig_system, a.sub_orig_system_reference, ');
Line: 2804

l('      CURSOR c1 is    select ''Y'' ');
Line: 2810

l('      select attribute_id ');
Line: 2814

l('      select attribute_id ');
Line: 2832

  get_select_str('CONTACTS', p_rule_id, l_sel_str, 'INT_TCA', NULL);
Line: 2841

/*                        select a.sub_orig_system, a.sub_orig_system_reference,
                a.site_orig_system, a.site_orig_system_reference,
                a.contact_orig_system, a.contact_orig_system_reference,
                a.contact_number, a.title, c.person_first_name || ' ' || c.person_last_name as person_name
                */
l('             from HZ_IMP_CONTACTS_INT a, HZ_IMP_PARTIES_INT c ');
Line: 2857

  get_select_str('CONTACTS', p_rule_id, l_sel_str, 'INT_TCA', NULL);
Line: 2860

 dbms_output.put_line('get_select_str (CONTACTS int_tca)' || l_sel_str);
Line: 2866

/*                select  a.sub_orig_system, a.sub_orig_system_reference,
                a.site_orig_system, a.site_orig_system_reference,
                a.contact_orig_system, a.contact_orig_system_reference,
                a.contact_number, a.title, c.party_name as person_name */
/* l('             from HZ_IMP_CONTACTS_INT a, hz_parties c ');
Line: 2879

  get_select_str('CONTACTS', p_rule_id, l_sel_str, 'INT_TCA', NULL);
Line: 2888

/*            select a.sub_orig_system, a.sub_orig_system_reference,
                a.site_orig_system, a.site_orig_system_reference,
                a.contact_orig_system, a.contact_orig_system_reference,
                a.contact_number, a.title, null person_name */
l('             from HZ_IMP_CONTACTS_INT a ');
Line: 2968

    l_trans_list.DELETE(I);
Line: 2977

l('         INSERT INTO HZ_SRCH_CONTACTS ( ');
Line: 2978

  get_insert_str('HZ_STAGED_CONTACTS', p_rule_id, l_sel_str, 'INT_INT');
Line: 2992

  get_insert_val_str('HZ_STAGED_CONTACTS', p_rule_id, l_sel_str, 'INT_INT');
Line: 3090

    l_trans_list.DELETE(I);
Line: 3098

l('         INSERT INTO HZ_SRCH_CONTACTS ( ');
Line: 3099

  get_insert_str('HZ_STAGED_CONTACTS', p_rule_id, l_sel_str, 'INT_TCA');
Line: 3113

  get_insert_val_str('HZ_STAGED_CONTACTS', p_rule_id, l_sel_str, 'INT_TCA');
Line: 3175

  get_select_str('CONTACT_POINTS', p_rule_id, l_sel_str, 'INT_INT', NULL);
Line: 3183

/*    	select a.email_address, a.party_orig_system_reference,
            a.party_orig_system, a.cp_orig_system, a.cp_orig_system_reference,
            a.site_orig_system, a.site_orig_system_reference, b.party_site_id,
            b.contact_point_id, b.party_id */
  l('    	from  HZ_IMP_CONTACTPTS_INT a,  HZ_IMP_CONTACTPTS_SG b --');
Line: 3233

       l_trans_list.DELETE(I);
Line: 3242

  l('         INSERT INTO HZ_SRCH_CPTS  ( ');
Line: 3243

  get_insert_str('HZ_STAGED_CONTACT_POINTS', p_rule_id, l_sel_str, 'INT_INT');
Line: 3262

   get_insert_val_str('HZ_STAGED_CONTACT_POINTS', p_rule_id, l_sel_str, 'INT_INT');
Line: 3331

  get_select_str('CONTACT_POINTS', p_rule_id, l_sel_str, 'INT_TCA', NULL);
Line: 3339

/*    	select a.email_address, a.party_orig_system_reference,
            a.party_orig_system, a.cp_orig_system, a.cp_orig_system_reference,
            a.site_orig_system, a.site_orig_system_reference
            */
l('     	from HZ_IMP_CONTACTPTS_INT a ');
Line: 3383

       l_trans_list.DELETE(I);
Line: 3390

l('         INSERT INTO HZ_SRCH_CPTS ( ');
Line: 3391

  get_insert_str('HZ_STAGED_CONTACT_POINTS', p_rule_id, l_sel_str, 'INT_TCA');
Line: 3407

   get_insert_val_str('HZ_STAGED_CONTACT_POINTS', p_rule_id, l_sel_str, 'INT_TCA');
Line: 3486

      FOR TX IN ( select STAGED_ATTRIBUTE_COLUMN
            from hz_trans_functions_b
            where attribute_id in (select attribute_id
            from hz_match_rule_primary
            where match_rule_id = p_rule_id)
            union
            select STAGED_ATTRIBUTE_COLUMN
            from hz_trans_functions_b
            where attribute_id in (select attribute_id
            from hz_match_rule_secondary
            where match_rule_id = p_rule_id)
            order by STAGED_ATTRIBUTE_COLUMN
            ) LOOP
                 l( '    H_' || TX.STAGED_ATTRIBUTE_COLUMN || ' CharList2000;');
Line: 3502

       FOR TX2 IN ( select attribute_id
            from hz_trans_attributes_vl
            --Fix for bug 4669257. Removing the hardcoded reference below.
            -- where userenv('LANG') = 'US'
            where attribute_id in (select attribute_id
            from hz_match_rule_primary
            where match_rule_id = p_rule_id
            union
            select attribute_id
            from hz_match_rule_secondary
            where match_rule_id = p_rule_id)
            and custom_attribute_procedure is null
            ) LOOP
               l( '    H_' || TX2.attribute_id || 'E CharList2000;');
Line: 3522

/*   l_sql_stmt := ' select count(distinct batch_id) from ' || p_table_name || ' where batch_id <> :1';
Line: 3525

            FOR TX5 IN ( select STAGED_ATTRIBUTE_COLUMN
                        from hz_trans_functions_b
                        where attribute_id in (select attribute_id
                            from hz_trans_attributes_b
                            where attribute_name = 'CONTACT_NAME'
                            and entity_name = 'CONTACTS')
                            and function_id in (select function_id
                                from hz_match_rule_primary e, hz_primary_trans d
                                where match_rule_id = p_rule_id
                                and e.PRIMARY_ATTRIBUTE_ID = d.PRIMARY_ATTRIBUTE_ID
                        union
                        select function_id
                        from hz_match_rule_secondary g, hz_secondary_trans f
                        where f.SECONDARY_ATTRIBUTE_ID = g.SECONDARY_ATTRIBUTE_ID
                        and match_rule_id = p_rule_id)
                        order by STAGED_ATTRIBUTE_COLUMN ) LOOP
--                 l( '    H_' || TX.STAGED_ATTRIBUTE_COLUMN || ' CharList2000;');
Line: 3558

            FOR TX3 IN ( select STAGED_ATTRIBUTE_COLUMN
                        from hz_trans_functions_b
                        where attribute_id in (select attribute_id
                            from hz_trans_attributes_b
                            where attribute_name = 'RAW_PHONE_NUMBER'
                            and entity_name = 'CONTACT_POINTS')
                            and function_id in (select function_id
                                from hz_match_rule_primary e, hz_primary_trans d
                                where match_rule_id = p_rule_id
                                and e.PRIMARY_ATTRIBUTE_ID = d.PRIMARY_ATTRIBUTE_ID
                        union
                        select function_id
                        from hz_match_rule_secondary g, hz_secondary_trans f
                        where f.SECONDARY_ATTRIBUTE_ID = g.SECONDARY_ATTRIBUTE_ID
                        and match_rule_id = p_rule_id)
                        order by STAGED_ATTRIBUTE_COLUMN ) LOOP
--                 l( '    H_' || TX.STAGED_ATTRIBUTE_COLUMN || ' CharList2000;');
Line: 3584

            FOR TX4 IN ( select STAGED_ATTRIBUTE_COLUMN
                        from hz_trans_functions_b
                        where attribute_id in (select attribute_id
                            from hz_trans_attributes_b
                            where attribute_name = 'ADDRESS'
                            and entity_name = 'PARTY_SITES')
                            and function_id in (select function_id
                                from hz_match_rule_primary e, hz_primary_trans d
                                where match_rule_id = p_rule_id
                                and e.PRIMARY_ATTRIBUTE_ID = d.PRIMARY_ATTRIBUTE_ID
                        union
                        select function_id
                        from hz_match_rule_secondary g, hz_secondary_trans f
                        where f.SECONDARY_ATTRIBUTE_ID = g.SECONDARY_ATTRIBUTE_ID
                        and match_rule_id = p_rule_id)
                        order by STAGED_ATTRIBUTE_COLUMN ) LOOP
--                 l( '    H_' || TX.STAGED_ATTRIBUTE_COLUMN || ' CharList2000;');
Line: 3628

    CURSOR c1 is select 'Y'
    from user_synonyms syn, dba_tab_columns col
    where syn.synonym_name = 'HZ_IMP_ADDRESSES_INT'
    and col.owner      =  syn.table_owner
    and col.table_name = syn.table_name
    and col.column_name = l_attribute_name
    and col.owner = l_owner;
Line: 3670

                select distinct 'Y' into x_bool
                from hz_trans_attributes_vl
                --Fix for bug 4669257. Removing the hardcoded reference below.
                --where userenv('LANG') = 'US'
                where entity_name = p_entity_name
                and custom_attribute_procedure is null
                and HZ_IMP_DQM_STAGE.EXIST_COL(attribute_name, p_entity_name) = 'Y'
--                and attribute_name not in ('SIC_CODE', 'SIC_CODE_TYPE', 'TAX_NAME', 'CATEGORY_CODE', 'IDENTIFYING_ADDRESS_FLAG', 'STATUS', 'PRIMARY_FLAG', 'REFERENCE_USE_FLAG' )
                and attribute_id in ( select attribute_id
                    from hz_match_rule_primary
                    where match_rule_id = p_rule_id
                    union
                    select attribute_id
                    from hz_match_rule_secondary
                    where match_rule_id = p_rule_id);
Line: 3719

  l_p_select_list VARCHAR2(1000);
Line: 3722

  l_ps_select_list VARCHAR2(1000);
Line: 3725

  l_c_select_list VARCHAR2(1000);
Line: 3728

  l_cpt_select_list VARCHAR2(1000);
Line: 3772

    EXECUTE IMMEDIATE 'select '||attr_name||' from HZ_IMP_PARTIES_INT where rownum=1';
Line: 3777

    EXECUTE IMMEDIATE 'select '||attr_name||' from HZ_IMP_ADDRESSES_INT where rownum=1';
Line: 3783

      EXECUTE IMMEDIATE 'select '||attr_name||' from HZ_IMP_CONTACTS_INT where rownum=1';
Line: 3786

        EXECUTE IMMEDIATE 'select '||attr_name||' from hz_imp_parties_int where rownum=1';
Line: 3792

    EXECUTE IMMEDIATE 'select '||attr_name||' from HZ_IMP_CONTACTPTS_INT where rownum=1';
Line: 3809

    SELECT 1
    FROM hz_match_rule_primary p, hz_primary_trans pt, hz_trans_functions_vl f
    WHERE p.match_rule_id = p_rule_id
    AND pt.PRIMARY_ATTRIBUTE_ID = p.PRIMARY_ATTRIBUTE_ID
    AND f.function_id = pt.function_id
    --Fix for bug 4669257. Removing the hardcoded reference below.
    --AND userenv('LANG') = 'US'
    AND nvl(f.ACTIVE_FLAG,'Y') = 'N'
    UNION
    SELECT 1
    FROM hz_match_rule_secondary s, hz_secondary_trans pt, hz_trans_functions_vl f
    WHERE s.match_rule_id = p_rule_id
    AND pt.SECONDARY_ATTRIBUTE_ID = s.SECONDARY_ATTRIBUTE_ID
    AND f.function_id = pt.function_id
    --Fix for bug 4669257. Removing the hardcoded reference below.
    --AND userenv('LANG') = 'US'
    AND nvl(f.ACTIVE_FLAG,'Y') = 'N';
Line: 3849

    SELECT 1 INTO l_batch_flag
    FROM HZ_MATCH_RULES_VL
    WHERE match_rule_id = l_rule_id;
Line: 3891

  UPDATE HZ_MATCH_RULES_B SET COMPILATION_FLAG = 'C' WHERE MATCH_RULE_ID = l_rule_id;
Line: 3900

    UPDATE HZ_MATCH_RULES_B SET COMPILATION_FLAG = 'U' WHERE MATCH_RULE_ID = l_rule_id;
Line: 3908

    UPDATE HZ_MATCH_RULES_B SET COMPILATION_FLAG = 'U' WHERE MATCH_RULE_ID = l_rule_id;
Line: 3922

    UPDATE HZ_MATCH_RULES_B SET COMPILATION_FLAG = 'U' WHERE MATCH_RULE_ID = l_rule_id;