DBA Data[Home] [Help]

APPS.EGO_DATA_SECURITY SQL Statements

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

Line: 77

    SELECT 'HZ_GROUP:'||group_membership_rel.object_id group_name
      FROM hz_relationships group_membership_rel
     WHERE group_membership_rel.RELATIONSHIP_CODE  = 'MEMBER_OF'
       AND group_membership_rel.status= 'A'
       AND group_membership_rel.start_date <= SYSDATE
       AND NVL(group_membership_rel.end_date, SYSDATE) >= SYSDATE
       AND group_membership_rel.subject_id = cp_orig_system_id;
Line: 110

    SELECT 'HZ_COMPANY:'||group_membership_rel.object_id company_name
      FROM hz_relationships group_membership_rel
     WHERE group_membership_rel.RELATIONSHIP_CODE  = 'EMPLOYEE_OF'
       AND group_membership_rel.status= 'A'
       AND group_membership_rel.start_date <= SYSDATE
       AND NVL(group_membership_rel.end_date, SYSDATE) >= SYSDATE
       AND group_membership_rel.subject_id = cp_orig_system_id;
Line: 170

         SELECT  count(1) into l_count
         FROM    hz_parties employee,
                 FND_USER FND_user,
                 PER_ALL_PEOPLE_F HR_EMPLOYEE
        WHERE   HR_EMPLOYEE.PERSON_ID              = FND_user.EMPLOYEE_ID
        AND fnd_user.start_date               <= SYSDATE
        AND NVL(fnd_user.end_date, SYSDATE)   >= SYSDATE
        AND (HR_EMPLOYEE.CURRENT_EMPLOYEE_FLAG = 'Y'
        OR HR_EMPLOYEE.CURRENT_NPW_FLAG       = 'Y'
           )
        AND HR_EMPLOYEE.EFFECTIVE_START_DATE            <= SYSDATE
        AND NVL(HR_EMPLOYEE.EFFECTIVE_END_DATE,SYSDATE) >= SYSDATE
        AND employee.party_type                          = 'PERSON'
        AND employee.status                              = 'A'
        AND employee.party_id                            = HR_EMPLOYEE.PARTY_ID
        AND user_name = p_user_name;
Line: 187

        SELECT  Count(1) into l_count
        FROM    hz_parties employee            ,
                FND_USER FND_user              ,
               PER_ALL_PEOPLE_F HR_EMPLOYEE
        WHERE   HR_EMPLOYEE.PERSON_ID              = FND_user.EMPLOYEE_ID
        AND fnd_user.start_date               <= SYSDATE
        AND NVL(fnd_user.end_date, SYSDATE)   >= SYSDATE
        AND (HR_EMPLOYEE.CURRENT_EMPLOYEE_FLAG = 'Y'
        OR HR_EMPLOYEE.CURRENT_NPW_FLAG       = 'Y')
        AND HR_EMPLOYEE.EFFECTIVE_START_DATE            <= SYSDATE
        AND NVL(HR_EMPLOYEE.EFFECTIVE_END_DATE,SYSDATE) >= SYSDATE
        AND employee.party_type                          = 'PERSON'
        AND employee.status                              = 'A'
        AND employee.party_id                            = HR_EMPLOYEE.PARTY_ID
        AND employee.party_id = l_party_id;
Line: 310

         select WR.orig_system, WR.orig_system_id
         into x_orig_system, x_orig_system_id
         from WF_ROLES WR
         where WR.NAME = x_user_name
         and   WR.ORIG_SYSTEM IN ('PER', 'FND_USR');
Line: 317

        SELECT party_id
        INTO x_orig_system_id
        FROM ego_user_v
        where user_name = x_user_name;
Line: 365

   select object_id
   into l_object_id
   from fnd_objects
   where obj_name=p_object_name;
Line: 381

select menu_id
  into l_role_id
  from fnd_menus
 where menu_name = p_role_name;
Line: 426

    SELECT pk1_column_name
           ,pk2_column_name
           ,pk3_column_name
           ,pk4_column_name
           ,pk5_column_name
           ,pk1_column_type
           ,pk2_column_type
           ,pk3_column_type
           ,pk4_column_type
           ,pk5_column_type
           , database_object_name
    FROM fnd_objects
    WHERE obj_name=p_object_name ;
Line: 726

    l_select_query_part        VARCHAR2(3000);
Line: 735

    SELECT menu_id
      FROM fnd_menu_entries
     WHERE function_id =
            (SELECT function_id
             FROM fnd_form_functions
             WHERE function_name = cp_function_name
            );
Line: 875

      'SELECT ''X'' ' ||
       ' FROM fnd_grants grants ' ||
      ' WHERE grants.object_id = :object_id ' ||
        ' AND grants.start_date <= SYSDATE '||
        ' AND NVL(grants.end_date, SYSDATE) >= SYSDATE ' ||
        ' AND grants.instance_type = :instance_type ' ||
        ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
               ' grants.grantee_key = :user_name ) '||
               ' OR ( grants.grantee_type = ''GROUP'' AND '||
               ' grants.grantee_key in ( '||l_group_info||' ))' ||
               ' OR ( grants.grantee_type = ''COMPANY'' AND '||
               ' grants.grantee_key in ( '||l_company_info||' ))' ||
               ' OR (grants.grantee_type = ''GLOBAL'' AND '||
               ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )) '||
        ' AND grants.menu_id IN (' || l_menu_info ||') ' ||
        ' AND grants.instance_pk1_value = :pk1_val ' ||
        ' AND ( grants.instance_pk2_value = :pk2_val OR' ||
        ' ( grants.instance_pk2_value = ''*NULL*'' AND :pk2_val is NULL )) '||
        ' AND ( grants.instance_pk3_value = :pk3_val OR '||
        ' ( grants.instance_pk3_value = ''*NULL*'' AND :pk3_val is NULL )) '||
        ' AND ( grants.instance_pk4_value = :pk4_val OR '||
        ' ( grants.instance_pk4_value = ''*NULL*'' AND :pk4_val is NULL )) '||
        ' AND ( grants.instance_pk5_value = :pk5_val OR '||
        ' ( grants.instance_pk5_value = ''*NULL*'' AND :pk5_val is NULL )) '; */
Line: 902

        'SELECT ''X'' ' ||
        ' FROM fnd_grants grants, ego_item_cat_denorm_hier cathier ' ||
        ' WHERE grants.object_id = :object_id ' ||
        ' AND grants.start_date <= SYSDATE '||
        ' AND NVL(grants.end_date, SYSDATE) >= SYSDATE ' ||
        ' AND grants.instance_type = :instance_type ' ||
        ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
               ' grants.grantee_key = :user_name ) '||
               ' OR ( grants.grantee_type = ''GROUP'' AND '||
               ' grants.grantee_key in ( '||l_group_info||' ))' ||
               ' OR ( grants.grantee_type = ''COMPANY'' AND '||
               ' grants.grantee_key in ( '||l_company_info||' ))' ||
               ' OR (grants.grantee_type = ''GLOBAL'' AND '||
               ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )) '||
        ' AND grants.menu_id IN (' || l_menu_info ||') ' ||
        ' AND grants.instance_pk1_value = cathier.parent_catalog_group_id ' ||
        ' AND cathier.child_catalog_group_id = :pk1_val ' ||
        ' AND ( grants.instance_pk2_value = :pk2_val OR' ||
        ' ( grants.instance_pk2_value = ''*NULL*'' AND :pk2_val is NULL )) '||
        ' AND ( grants.instance_pk3_value = :pk3_val OR '||
        ' ( grants.instance_pk3_value = ''*NULL*'' AND :pk3_val is NULL )) '||
        ' AND ( grants.instance_pk4_value = :pk4_val OR '||
        ' ( grants.instance_pk4_value = ''*NULL*'' AND :pk4_val is NULL )) '||
        ' AND ( grants.instance_pk5_value = :pk5_val OR '||
        ' ( grants.instance_pk5_value = ''*NULL*'' AND :pk5_val is NULL )) ';
Line: 929

        'SELECT ''X'' ' ||
        ' FROM fnd_grants grants ' ||
        ' WHERE grants.object_id = :object_id ' ||
        ' AND grants.start_date <= SYSDATE '||
        ' AND NVL(grants.end_date, SYSDATE) >= SYSDATE ' ||
        ' AND grants.instance_type = :instance_type ' ||
        ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
               ' grants.grantee_key = :user_name ) '||
               ' OR ( grants.grantee_type = ''GROUP'' AND '||
               ' grants.grantee_key in ( '||l_group_info||' ))' ||
               ' OR ( grants.grantee_type = ''COMPANY'' AND '||
               ' grants.grantee_key in ( '||l_company_info||' ))' ||
               ' OR (grants.grantee_type = ''GLOBAL'' AND '||
               ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )) '||
        ' AND grants.menu_id IN (' || l_menu_info ||') ' ||
        ' AND grants.instance_pk1_value = :pk1_val ' ||
        ' AND ( grants.instance_pk2_value = :pk2_val OR' ||
        ' ( grants.instance_pk2_value = ''*NULL*'' AND :pk2_val is NULL )) '||
        ' AND ( grants.instance_pk3_value = :pk3_val OR '||
        ' ( grants.instance_pk3_value = ''*NULL*'' AND :pk3_val is NULL )) '||
        ' AND ( grants.instance_pk4_value = :pk4_val OR '||
        ' ( grants.instance_pk4_value = ''*NULL*'' AND :pk4_val is NULL )) '||
        ' AND ( grants.instance_pk5_value = :pk5_val OR '||
        ' ( grants.instance_pk5_value = ''*NULL*'' AND :pk5_val is NULL )) ';
Line: 991

    /*l_select_query_part:=
             'SELECT '|| l_pk_column_names ||
             ' FROM  '|| l_db_object_name  ||
             ' WHERE '; */
Line: 997

  l_select_query_part:=
             'SELECT '|| l_pk_column_names ||
             ' FROM  '|| l_db_object_name  || ', ego_item_cat_denorm_hier cathier'||
             ' WHERE ';
Line: 1002

  l_select_query_part:=
             'SELECT '|| l_pk_column_names ||
             ' FROM  '|| l_db_object_name  ||
             ' WHERE ';
Line: 1010

       l_select_query_part := l_select_query_part ||
            ' ( '||l_db_pk1_column||' = :pk1_val '||
             ' OR ( '||l_db_pk1_column||' is NULL AND :pk1_val is NULL))';
Line: 1015

       l_select_query_part := l_select_query_part ||
        ' AND (  '||l_db_pk2_column||' = :pk2_val '||
             ' OR ( '||l_db_pk2_column||' is NULL AND :pk2_val is NULL))';
Line: 1020

       l_select_query_part := l_select_query_part ||
        ' AND ( '||l_db_pk3_column||' = :pk3_val '||
             ' OR ( '||l_db_pk3_column||' is NULL AND :pk3_val is NULL))';
Line: 1025

       l_select_query_part := l_select_query_part ||
       ' AND ( '||l_db_pk4_column||' = :pk4_val '||
             ' OR ( '||l_db_pk4_column||' is NULL AND :pk4_val is NULL))';
Line: 1030

       l_select_query_part := l_select_query_part ||
        ' AND ( '||l_db_pk5_column||' = :pk5_val '||
             ' OR ( '||l_db_pk5_column||' is NULL AND :pk5_val is NULL))';
Line: 1038

           l_select_query_part := l_select_query_part || ' AND item_catalog_group_id = cathier.child_catalog_group_id AND ';
Line: 1040

           l_select_query_part := l_select_query_part || ' AND ';
Line: 1044

      l_dynamic_sql := l_select_query_part;
Line: 1058

      ' SELECT DISTINCT sets.instance_SET_ID, sets.predicate ' ||
        ' FROM fnd_grants grants, ' ||
             ' fnd_object_instance_sets  sets '||
       ' WHERE grants.object_id = :object_id ' ||
         ' AND grants.start_date <= SYSDATE ' ||
         ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE '||
         ' AND grants.instance_type = :instance_type ' ||
         ' AND ( ( grants.grantee_type = ''USER'' AND '||
               ' grants.grantee_key = :user_name ) '||
               ' OR ( grants.grantee_type = ''GROUP'' AND '||
               ' grants.grantee_key in ( '||l_group_info||' ))' ||
               ' OR ( grants.grantee_type = ''COMPANY'' AND '||
               ' grants.grantee_key in ( '||l_company_info||' ))' ||
               ' OR (grants.grantee_type = ''GLOBAL'' AND '||
               ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )) '||
        ' AND grants.menu_id IN (' || l_menu_info ||') ' ||
        ' AND sets.instance_set_id = grants.instance_set_id ' ||
        ' AND sets.object_id = grants.object_id ';
Line: 1241

    SELECT p.parent_role_id parent_role_id
      FROM fnd_menu_entries r, fnd_form_functions f,
           fnd_menus m, ego_obj_role_mappings p
     WHERE r.function_id       = f.function_id
       AND r.menu_id           = m.menu_id
       AND f.function_name     = cp_function
       AND m.menu_id           = p.child_role_id
       AND p.child_object_id   = cp_object_id
       AND p.parent_object_id  = cp_parent_object_id
       AND p.child_object_type = cp_object_type;
Line: 1437

    ' SELECT ''X'' ' ||
      ' FROM fnd_grants grants ' ||
     ' WHERE grants.object_id = :object_id' ||
       ' AND grants.start_date <= SYSDATE ' ||
       ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
       ' AND grants.instance_type = :instance_type ' ||
       ' AND grants.instance_pk1_value = :parent_instance_pk1_value ' ||
       ' AND grants.instance_pk2_value = :pk2_value ' ||
       ' AND grants.instance_pk3_value = :pk3_value ' ||
       ' AND grants.instance_pk4_value = :pk4_value ' ||
       ' AND grants.instance_pk5_value = :pk5_value ' ||
       ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
               ' grants.grantee_key = :user_name ) '||
            ' OR (grants.grantee_type = ''GROUP'' AND ' ||
                ' grants.grantee_key in ( '||l_group_info||' )) ' ||
            ' OR (grants.grantee_type = ''COMPANY'' AND ' ||
                ' grants.grantee_key in ( '||l_company_info||' )) ' ||
            ' OR (grants.grantee_type = ''GLOBAL'' AND ' ||
                ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )) '||
       ' AND grants.menu_id IN (' || l_menu_info ||') '; */
Line: 1461

       ' SELECT ''X'' ' ||
       ' FROM fnd_grants grants , ego_item_cat_denorm_hier cathier ' ||
       ' WHERE grants.object_id = :object_id' ||
       ' AND grants.start_date <= SYSDATE ' ||
       ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
       ' AND grants.instance_type = :instance_type ' ||
       ' AND grants.instance_pk1_value = cathier.parent_catalog_group_id ' ||
       ' AND cathier.child_catalog_group_id = :parent_instance_pk1_value ' ||
       ' AND grants.instance_pk2_value = :pk2_value ' ||
       ' AND grants.instance_pk3_value = :pk3_value ' ||
       ' AND grants.instance_pk4_value = :pk4_value ' ||
       ' AND grants.instance_pk5_value = :pk5_value ' ||
       ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
               ' grants.grantee_key = :user_name ) '||
            ' OR (grants.grantee_type = ''GROUP'' AND ' ||
                ' grants.grantee_key in ( '||l_group_info||' )) ' ||
            ' OR (grants.grantee_type = ''COMPANY'' AND ' ||
                ' grants.grantee_key in ( '||l_company_info||' )) ' ||
            ' OR (grants.grantee_type = ''GLOBAL'' AND ' ||
                ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )) '||
            ' AND grants.menu_id IN (' || l_menu_info ||') ';
Line: 1484

       ' SELECT ''X'' ' ||
       ' FROM fnd_grants grants ' ||
       ' WHERE grants.object_id = :object_id' ||
       ' AND grants.start_date <= SYSDATE ' ||
       ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
       ' AND grants.instance_type = :instance_type ' ||
       ' AND grants.instance_pk1_value = :parent_instance_pk1_value ' ||
       ' AND grants.instance_pk2_value = :pk2_value ' ||
       ' AND grants.instance_pk3_value = :pk3_value ' ||
       ' AND grants.instance_pk4_value = :pk4_value ' ||
       ' AND grants.instance_pk5_value = :pk5_value ' ||
       ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
               ' grants.grantee_key = :user_name ) '||
            ' OR (grants.grantee_type = ''GROUP'' AND ' ||
                ' grants.grantee_key in ( '||l_group_info||' )) ' ||
            ' OR (grants.grantee_type = ''COMPANY'' AND ' ||
                ' grants.grantee_key in ( '||l_company_info||' )) ' ||
            ' OR (grants.grantee_type = ''GLOBAL'' AND ' ||
                ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )) '||
       ' AND grants.menu_id IN (' || l_menu_info ||') ';
Line: 1560

    ' SELECT DISTINCT instance_sets.predicate ' ||
      ' FROM fnd_grants grants, fnd_object_instance_sets instance_sets ' ||
     ' WHERE grants.instance_type = :instance_type '||
       ' AND grants.start_date <= SYSDATE ' ||
       ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
       ' AND grants.instance_set_id = instance_sets.instance_set_id ' ||
       ' AND grants.object_id = :object_id ' ||
       ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
               ' grants.grantee_key = :user_name ) '||
            ' OR (grants.grantee_type = ''GROUP'' AND ' ||
                ' grants.grantee_key in ( '||l_group_info||' )) ' ||
            ' OR (grants.grantee_type = ''COMPANY'' AND ' ||
                ' grants.grantee_key in ( '||l_company_info||' )) ' ||
            ' OR (grants.grantee_type = ''GLOBAL'' AND ' ||
                ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )) '||
       ' AND grants.menu_id IN (' || l_menu_info ||') ';
Line: 1623

        'SELECT ''X'' '||
         ' FROM '|| l_db_object_name ||
        ' WHERE '; */
Line: 1629

         'SELECT ''X'' '||
         ' FROM '|| l_db_object_name || ', ego_item_cat_denorm_hier cathier'||
         ' WHERE ';
Line: 1634

        'SELECT ''X'' '||
        ' FROM '|| l_db_object_name ||
        ' WHERE ';
Line: 1837

    l_select_query_part    VARCHAR2(3000);
Line: 1974

    /*l_select_query_part:=
             'SELECT '|| l_pk_column_names ||
             ' FROM  '|| l_db_object_name  ||
             ' WHERE '; */
Line: 1979

    l_select_query_part:=
             'SELECT '|| l_pk_column_names ||
             ' FROM  '|| l_db_object_name  || ', ego_item_cat_denorm_hier cathier'||
             ' WHERE ';
Line: 1984

    l_select_query_part:=
             'SELECT '|| l_pk_column_names ||
             ' FROM  '|| l_db_object_name  ||
             ' WHERE ';
Line: 1992

       l_select_query_part := l_select_query_part ||
            ' ( '||l_db_pk1_column||' = :pk1_val '||
             ' OR ( '||l_db_pk1_column||' is NULL AND :pk1_val is NULL))';
Line: 1997

       l_select_query_part := l_select_query_part ||
        ' AND (  '||l_db_pk2_column||' = :pk2_val '||
             ' OR ( '||l_db_pk2_column||' is NULL AND :pk2_val is NULL))';
Line: 2002

       l_select_query_part := l_select_query_part ||
        ' AND ( '||l_db_pk3_column||' = :pk3_val '||
             ' OR ( '||l_db_pk3_column||' is NULL AND :pk3_val is NULL))';
Line: 2007

       l_select_query_part := l_select_query_part ||
       ' AND ( '||l_db_pk4_column||' = :pk4_val '||
             ' OR ( '||l_db_pk4_column||' is NULL AND :pk4_val is NULL))';
Line: 2012

       l_select_query_part := l_select_query_part ||
        ' AND ( '||l_db_pk5_column||' = :pk5_val '||
             ' OR ( '||l_db_pk5_column||' is NULL AND :pk5_val is NULL))';
Line: 2020

        l_select_query_part := l_select_query_part || ' AND item_catalog_group_id = cathier.child_catalog_group_id AND ';
Line: 2022

         l_select_query_part := l_select_query_part || ' AND ';
Line: 2052

      ' SELECT DISTINCT sets.instance_set_id, sets.predicate ' ||
        ' FROM fnd_grants grants, ' ||
             ' fnd_object_instance_sets  sets '||
      ' WHERE grants.instance_type = :instance_type '||
       ' AND grants.start_date <= SYSDATE ' ||
       ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
       ' AND grants.instance_set_id = sets.instance_set_id ' ||
       ' AND grants.object_id = :object_id ' ||
       ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
               ' grants.grantee_key = :user_name ) '||
            ' OR (grants.grantee_type = ''GROUP'' AND ' ||
                ' grants.grantee_key in ( '||l_group_info||' )) ' ||
            ' OR (grants.grantee_type = ''COMPANY'' AND ' ||
                ' grants.grantee_key in ( '||l_company_info||' )) ' ||
            ' OR (grants.grantee_type = ''GLOBAL'' AND ' ||
                ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )) ';
Line: 2089

      l_dynamic_sql :=l_select_query_part  ||
                      ' ( ' ||  l_one_set_predicate || ' ) ';
Line: 2095

                   ' l_select_query_part: '||l_select_query_part||
                   ' - l_one_set_predicate: '||l_one_set_predicate
                 );
Line: 2277

      'SELECT DISTINCT fnd_functions.function_name ' ||
       ' FROM fnd_grants grants, ' ||
            ' fnd_form_functions fnd_functions, ' ||
            ' fnd_menu_entries cmf '||
      ' WHERE grants.object_id = :object_id ' ||
       ' AND grants.start_date <= SYSDATE ' ||
       ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
       ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
               ' grants.grantee_key = :user_name ) '||
            ' OR (grants.grantee_type = ''GROUP'' AND ' ||
                ' grants.grantee_key in ( '||l_group_info||' )) ' ||
            ' OR (grants.grantee_type = ''COMPANY'' AND ' ||
                ' grants.grantee_key in ( '||l_company_info||' )) ' ||
            ' OR (grants.grantee_type = ''GLOBAL'' AND ' ||
                ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') ))'||
        ' AND cmf.function_id = fnd_functions.function_id ' ||
        ' AND cmf.menu_id = grants.menu_id '; */
Line: 2297

      'SELECT DISTINCT fnd_functions.function_name ' ||
       ' FROM fnd_grants grants, ' ||
            ' fnd_form_functions fnd_functions, ' ||
            ' fnd_menu_entries cmf, '||
            ' ego_item_cat_denorm_hier cathier '||
      ' WHERE grants.object_id = :object_id ' ||
       ' AND grants.start_date <= SYSDATE ' ||
       ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
       ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
               ' grants.grantee_key = :user_name ) '||
            ' OR (grants.grantee_type = ''GROUP'' AND ' ||
                ' grants.grantee_key in ( '||l_group_info||' )) ' ||
            ' OR (grants.grantee_type = ''COMPANY'' AND ' ||
                ' grants.grantee_key in ( '||l_company_info||' )) ' ||
            ' OR (grants.grantee_type = ''GLOBAL'' AND ' ||
                ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') ))'||
        ' AND cmf.function_id = fnd_functions.function_id ' ||
        ' AND cmf.menu_id = grants.menu_id ';
Line: 2317

      'SELECT DISTINCT fnd_functions.function_name ' ||
       ' FROM fnd_grants grants, ' ||
            ' fnd_form_functions fnd_functions, ' ||
            ' fnd_menu_entries cmf '||
      ' WHERE grants.object_id = :object_id ' ||
       ' AND grants.start_date <= SYSDATE ' ||
       ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
       ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
               ' grants.grantee_key = :user_name ) '||
            ' OR (grants.grantee_type = ''GROUP'' AND ' ||
                ' grants.grantee_key in ( '||l_group_info||' )) ' ||
            ' OR (grants.grantee_type = ''COMPANY'' AND ' ||
                ' grants.grantee_key in ( '||l_company_info||' )) ' ||
            ' OR (grants.grantee_type = ''GLOBAL'' AND ' ||
                ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') ))'||
        ' AND cmf.function_id = fnd_functions.function_id ' ||
        ' AND cmf.menu_id = grants.menu_id ';
Line: 2546

    l_select_query_part        VARCHAR2(3000);
Line: 2682

   /* l_select_query_part:=
             'SELECT '|| l_pk_column_names ||
             ' FROM  '|| l_db_object_name  ||
             ' WHERE ';*/
Line: 2687

    l_select_query_part:=
             'SELECT '|| l_pk_column_names ||
             ' FROM  '|| l_db_object_name  ||', ego_item_cat_denorm_hier cathier'||
             ' WHERE ';
Line: 2692

    l_select_query_part:=
             'SELECT '|| l_pk_column_names ||
             ' FROM  '|| l_db_object_name  ||
             ' WHERE ';
Line: 2700

       l_select_query_part := l_select_query_part ||
            ' ( '||l_db_pk1_column||' = :pk1_val '||
             ' OR ( '||l_db_pk1_column||' is NULL AND :pk1_val is NULL))';
Line: 2705

       l_select_query_part := l_select_query_part ||
        ' AND (  '||l_db_pk2_column||' = :pk2_val '||
             ' OR ( '||l_db_pk2_column||' is NULL AND :pk2_val is NULL))';
Line: 2710

       l_select_query_part := l_select_query_part ||
        ' AND ( '||l_db_pk3_column||' = :pk3_val '||
             ' OR ( '||l_db_pk3_column||' is NULL AND :pk3_val is NULL))';
Line: 2715

       l_select_query_part := l_select_query_part ||
       ' AND ( '||l_db_pk4_column||' = :pk4_val '||
             ' OR ( '||l_db_pk4_column||' is NULL AND :pk4_val is NULL))';
Line: 2720

       l_select_query_part := l_select_query_part ||
        ' AND ( '||l_db_pk5_column||' = :pk5_val '||
             ' OR ( '||l_db_pk5_column||' is NULL AND :pk5_val is NULL))';
Line: 2727

        l_select_query_part := l_select_query_part || ' AND  item_catalog_group_id = cathier.child_catalog_group_id AND ';
Line: 2729

        l_select_query_part := l_select_query_part || ' AND ';
Line: 2734

               ,p_message   => 'Select Query Part '||l_select_query_part
               );
Line: 2740

    ' SELECT DISTINCT sets.instance_set_id, sets.predicate ' ||
      ' FROM fnd_grants grants, fnd_object_instance_sets sets' ||
      ' WHERE grants.object_id = :object_id ' ||
        ' AND grants.start_date <= SYSDATE ' ||
        ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE '||
        ' AND grants.instance_type = :instance_type ' ||
        ' AND ( ( grants.grantee_type = ''USER'' AND '||
               ' grants.grantee_key = :user_name ) '||
               ' OR ( grants.grantee_type = ''GROUP'' AND '||
               ' grants.grantee_key in ( '||l_group_info||' ))' ||
               ' OR ( grants.grantee_type = ''COMPANY'' AND '||
               ' grants.grantee_key in ( '||l_company_info||' ))' ||
               ' OR (grants.grantee_type = ''GLOBAL'' AND '||
               ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )) '||
      ' AND sets.instance_set_id = grants.instance_set_id ' ||
      ' AND sets.object_id = grants.object_id ';
Line: 2779

      l_dynamic_sql := l_select_query_part ||
                       ' (' ||  l_one_set_predicate || ') ';
Line: 2887

       'SELECT DISTINCT fnd_functions.function_name ' ||
        ' FROM fnd_grants grants, ' ||
             ' fnd_form_functions fnd_functions, ' ||
             ' fnd_menu_entries cmf, '||
             ' ego_obj_role_mappings mapping '||
       ' WHERE grants.object_id = :object_id '||
         ' AND grants.start_date <= SYSDATE '||
         ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
         ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
                ' grants.grantee_key = :user_name ) '||
             ' OR (grants.grantee_type = ''GROUP'' AND ' ||
                 ' grants.grantee_key in ( '||l_group_info||' )) ' ||
             ' OR (grants.grantee_type = ''COMPANY'' AND ' ||
                 ' grants.grantee_key in ( '||l_company_info||' )) ' ||
             ' OR (grants.grantee_type = ''GLOBAL'' AND ' ||
                 ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') ))'||
         ' AND mapping.child_role_id = cmf.menu_id ' ||
         ' AND mapping.parent_role_id = grants.menu_id ' ||
         ' AND mapping.child_object_id = :child_object_id ' ||
         ' AND mapping.parent_object_id = :parent_object_id ' ||
         ' AND mapping.child_object_type = :object_type ' ||
         ' AND cmf.function_id = fnd_functions.function_id ';
Line: 3027

            ' SELECT DISTINCT fnd_functions.function_name ' ||
              ' FROM fnd_form_functions fnd_functions, ' ||
                   ' fnd_menu_entries cmf, ' ||
                   ' ego_obj_role_mappings mapping, ' ||
                   ' fnd_menus menus ' ||
            ' WHERE menus.menu_name = :profile_role ' ||
              ' AND mapping.parent_role_id = menus.menu_id ' ||
              ' AND mapping.child_role_id = cmf.menu_id ' ||
              ' AND mapping.child_object_id = :profile_ch_object_id ' ||
              ' AND mapping.parent_object_id = :profile_parent_object_id ' ||
              ' AND mapping.child_object_type = :profile_ch_object_type ' ||
              ' AND cmf.function_id = fnd_functions.function_id ';
Line: 3575

        l_aggregate_predicate := 'EXISTS ( SELECT ''X'' ';
Line: 3577

        l_aggregate_predicate := l_pk_column_names || ' IN ( SELECT ' ||l_type_converted_val_cols;
Line: 3671

      ' SELECT DISTINCT instance_sets.predicate ' ||
        ' FROM fnd_grants grants, fnd_form_functions functions, ' ||
             ' fnd_menu_entries cmf, fnd_object_instance_sets instance_sets ' ||
       ' WHERE grants.instance_type = :instance_type ' ||
         ' AND grants.start_date <= SYSDATE ' ||
         ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
         ' AND cmf.function_id = functions.function_id ' ||
         ' AND cmf.menu_id = grants.menu_id ' ||
         ' AND grants.instance_set_id = instance_sets.instance_set_id ' ||
         ' AND grants.object_id = :object_id ' ||
         ' AND functions.function_name = :function ' ||
         ' AND ((grants.grantee_type = ''USER'' ' ||
               ' AND grants.grantee_key = :grantee_key )' ||
              ' OR (grants.grantee_type = ''GROUP'' ' ||
                  ' AND grants.grantee_key in ('||l_group_info||' ))' ||
              ' OR (grants.grantee_type = ''COMPANY'' ' ||
                  ' AND grants.grantee_key in ( '||l_company_info||' ))' ||
              ' OR (grants.grantee_type = ''GLOBAL'' ' ||
                  ' AND grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL''))) ';
Line: 3749

                                           ' UNION ALL (SELECT ''X'' ' || ' FROM ' ||
                                           l_db_object_name || ' WHERE ' ||
                                           l_orig_pk1_column || '=' || p_pk1_alias, 1, g_pred_buf_size);*/
Line: 3755

                                           ' UNION ALL (SELECT ''X'' ' || ' FROM ' ||
                                           l_db_object_name ||', ego_item_cat_denorm_hier cathier WHERE item_catalog_group_id = cathier.child_catalog_group_id AND ' ||
                                           l_orig_pk1_column || '=' || p_pk1_alias, 1, g_pred_buf_size);
Line: 3761

                                           ' UNION ALL (SELECT ''X'' ' || ' FROM ' ||
                                           l_db_object_name || ' WHERE ' ||
                                           l_orig_pk1_column || '=' || p_pk1_alias, 1, g_pred_buf_size);
Line: 3796

                                           ' UNION ALL (SELECT ' ||
                                           l_pk_orig_column_names || ' FROM ' ||
                                           l_db_object_name || ' WHERE ' ||
                                           l_set_predicates || '))',
                                           1, g_pred_buf_size);
Line: 3903

       SELECT party_type
       FROM hz_parties
       WHERE party_id=cp_party_id;
Line: 4132

          ' SELECT INSTANCE_PK1_VALUE' ||
          ' FROM fnd_grants grants, ' ||
               ' fnd_form_functions functions, ' ||
               ' fnd_menu_entries cmf ' ||
          ' WHERE grants.INSTANCE_PK1_VALUE=to_char('||p_pk1_alias||')'||
          ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
          ' AND grants.instance_type= ''INSTANCE'' ' ||
          ' AND cmf.function_id = functions.function_id ' ||
          ' AND cmf.menu_id = grants.menu_id ' ||
          ' AND grants.object_id = ' || l_object_id ||
          ' AND functions.function_name = ''' || p_function || '''' ||
          ' AND   (   (    grants.grantee_type = ''USER'' ' ||
                    ' AND grants.grantee_key = '''||l_user_name||''')'||
                 ' OR (   grants.grantee_type = ''GROUP'' '||
                    ' AND grants.grantee_key in '||
                      ' ( '|| l_group_info || ')) ' ||
                 ' OR (   grants.grantee_type = ''COMPANY'' '||
                    ' AND grants.grantee_key in '||
                      ' ( '|| l_company_info || ')) ' ||
                 ' OR (grants.grantee_type = ''GLOBAL'' AND grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )))';*/
Line: 4155

          ' SELECT INSTANCE_PK1_VALUE' ||
          ' FROM fnd_grants grants, ' ||
               ' fnd_form_functions functions, ' ||
               ' fnd_menu_entries cmf, ' ||
         ' ego_item_cat_denorm_hier cathier ' ||
          ' WHERE grants.INSTANCE_PK1_VALUE=to_char(cathier.parent_catalog_group_id)' ||
    ' AND cathier.child_catalog_group_id = to_char('||p_pk1_alias||')' ||
          ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
          ' AND grants.instance_type= ''INSTANCE'' ' ||
          ' AND cmf.function_id = functions.function_id ' ||
          ' AND cmf.menu_id = grants.menu_id ' ||
          ' AND grants.object_id = ' || l_object_id ||
          ' AND functions.function_name = ''' || p_function || '''' ||
          ' AND   (   (    grants.grantee_type = ''USER'' ' ||
                    ' AND grants.grantee_key = '''||l_user_name||''')'||
                 ' OR (   grants.grantee_type = ''GROUP'' '||
                    ' AND grants.grantee_key in '||
                      ' ( '|| l_group_info || ')) ' ||
                 ' OR (   grants.grantee_type = ''COMPANY'' '||
                    ' AND grants.grantee_key in '||
                      ' ( '|| l_company_info || ')) ' ||
                 ' OR (grants.grantee_type = ''GLOBAL'' AND grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )))';
Line: 4180

          ' SELECT INSTANCE_PK1_VALUE' ||
          ' FROM fnd_grants grants, ' ||
               ' fnd_form_functions functions, ' ||
               ' fnd_menu_entries cmf ' ||
          ' WHERE grants.INSTANCE_PK1_VALUE=to_char('||p_pk1_alias||')'||
          ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
          ' AND grants.instance_type= ''INSTANCE'' ' ||
          ' AND cmf.function_id = functions.function_id ' ||
          ' AND cmf.menu_id = grants.menu_id ' ||
          ' AND grants.object_id = ' || l_object_id ||
          ' AND functions.function_name = ''' || p_function || '''' ||
          ' AND   (   (    grants.grantee_type = ''USER'' ' ||
                    ' AND grants.grantee_key = '''||l_user_name||''')'||
                 ' OR (   grants.grantee_type = ''GROUP'' '||
                    ' AND grants.grantee_key in '||
                      ' ( '|| l_group_info || ')) ' ||
                 ' OR (   grants.grantee_type = ''COMPANY'' '||
                    ' AND grants.grantee_key in '||
                      ' ( '|| l_company_info || ')) ' ||
                 ' OR (grants.grantee_type = ''GLOBAL'' AND grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )))';
Line: 4207

    /*l_sub_pred_clause:= ' UNION ALL  ( SELECT to_char('
                   ||l_pk_orig_column_names || ') FROM ' ||
                   l_db_object_name ||
                   ' WHERE ' || l_pk_orig_column_names||'='||p_pk1_alias ||
                   ' AND ';*/
Line: 4213

       l_sub_pred_clause:= ' UNION ALL  ( SELECT to_char('
                   ||l_pk_orig_column_names || ') FROM ' ||
                   l_db_object_name ||
                   ' , ego_item_cat_denorm_hier cathier WHERE ' || l_pk_orig_column_names||'='||p_pk1_alias ||
                   ' AND ';
Line: 4219

      l_sub_pred_clause:= ' UNION ALL  ( SELECT to_char('
                   ||l_pk_orig_column_names || ') FROM ' ||
                   l_db_object_name ||
                   ' WHERE ' || l_pk_orig_column_names||'='||p_pk1_alias ||
                   ' AND ';
Line: 4229

      ' SELECT DISTINCT instance_sets.predicate ' ||
        ' FROM fnd_grants grants, fnd_form_functions functions, ' ||
             ' fnd_menu_entries cmf, fnd_object_instance_sets instance_sets ' ||
       ' WHERE grants.instance_type = :instance_type ' ||
         ' AND grants.start_date <= SYSDATE ' ||
         ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
         ' AND cmf.function_id = functions.function_id ' ||
         ' AND cmf.menu_id = grants.menu_id ' ||
         ' AND grants.instance_set_id = instance_sets.instance_set_id ' ||
         ' AND grants.object_id = :object_id ' ||
         ' AND functions.function_name = :function ' ||
         ' AND ((grants.grantee_type = ''USER'' ' ||
               ' AND grants.grantee_key = :grantee_key )' ||
              ' OR (grants.grantee_type = ''GROUP'' ' ||
                  ' AND grants.grantee_key in ( '||l_group_info||' ))' ||
              ' OR (grants.grantee_type = ''COMPANY'' ' ||
                  ' AND grants.grantee_key in ( '||l_company_info||' ))' ||
              ' OR (grants.grantee_type = ''GLOBAL'' ' ||
                  ' AND grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL''))) ';
Line: 4390

       SELECT party_type
       FROM hz_parties
       WHERE party_id=cp_party_id;
Line: 4623

          ' SELECT INSTANCE_PK1_VALUE' ||
          ' FROM fnd_grants grants, ' ||
               ' fnd_form_functions functions, ' ||
               ' fnd_menu_entries cmf ' ||
          ' WHERE grants.start_date <= sysdate ' ||
          ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
          ' AND grants.instance_type= ''INSTANCE'' ' ||
          ' AND cmf.function_id = functions.function_id ' ||
          ' AND cmf.menu_id = grants.menu_id ' ||
          ' AND grants.object_id = ' || l_object_id ||
          ' AND functions.function_name = ''' || p_function   || '''' ||
          ' AND   (   (    grants.grantee_type = ''USER'' ' ||
                    ' AND grants.grantee_key = '''||l_user_name||''')'||
                 ' OR (   grants.grantee_type = ''GROUP'' '||
                    ' AND grants.grantee_key in '||
                    ' ( '|| l_group_info || ')) ' ||
                 ' OR (   grants.grantee_type = ''COMPANY'' '||
                    ' AND grants.grantee_key in '||
                    ' ( '|| l_company_info || ')) ' ||
                 ' OR (grants.grantee_type = ''GLOBAL'' AND grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )))';*/
Line: 4645

            ' SELECT INSTANCE_PK1_VALUE' ||
            ' FROM fnd_grants grants, ' ||
                 ' fnd_form_functions functions, ' ||
                 ' fnd_menu_entries cmf, ' ||
           'ego_item_cat_denorm_hier cathier ' ||
      'WHERE grants.INSTANCE_PK1_VALUE=to_char(cathier.parent_catalog_group_id) '||
      'AND cathier.child_catalog_group_id = to_char('||p_pk1_alias||')' ||
            ' AND grants.start_date <= sysdate ' ||
            ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
            ' AND grants.instance_type= ''INSTANCE'' ' ||
            ' AND cmf.function_id = functions.function_id ' ||
            ' AND cmf.menu_id = grants.menu_id ' ||
            ' AND grants.object_id = ' || l_object_id ||
            ' AND functions.function_name = ''' || p_function   || '''' ||
            ' AND   (   (    grants.grantee_type = ''USER'' ' ||
                      ' AND grants.grantee_key = '''||l_user_name||''')'||
                   ' OR (   grants.grantee_type = ''GROUP'' '||
                      ' AND grants.grantee_key in '||
                      ' ( '|| l_group_info || ')) ' ||
                   ' OR (   grants.grantee_type = ''COMPANY'' '||
                      ' AND grants.grantee_key in '||
                      ' ( '|| l_company_info || ')) ' ||
                   ' OR (grants.grantee_type = ''GLOBAL'' AND grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )))';
Line: 4670

            ' SELECT INSTANCE_PK1_VALUE' ||
            ' FROM fnd_grants grants, ' ||
                 ' fnd_form_functions functions, ' ||
                 ' fnd_menu_entries cmf ' ||
            ' WHERE grants.start_date <= sysdate ' ||
            ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
            ' AND grants.instance_type= ''INSTANCE'' ' ||
            ' AND cmf.function_id = functions.function_id ' ||
            ' AND cmf.menu_id = grants.menu_id ' ||
            ' AND grants.object_id = ' || l_object_id ||
            ' AND functions.function_name = ''' || p_function   || '''' ||
            ' AND   (   (   grants.grantee_type = ''USER'' ' ||
                      ' AND grants.grantee_key = '''||l_user_name||''')'||
                   ' OR (   grants.grantee_type = ''GROUP'' '||
                      ' AND grants.grantee_key in '||
                      ' ( '|| l_group_info || ')) ' ||
                   ' OR (   grants.grantee_type = ''COMPANY'' '||
                      ' AND grants.grantee_key in '||
                      ' ( '|| l_company_info || ')) ' ||
                   ' OR (grants.grantee_type = ''GLOBAL'' AND grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )))';
Line: 4697

    /*l_sub_pred_clause:=' UNION ALL  ( SELECT to_char(' ||
                   l_pk_orig_column_names || ') FROM ' ||
                   l_db_object_name || ' WHERE ';*/
Line: 4701

      l_sub_pred_clause:=' UNION ALL  ( SELECT to_char(' ||
                   l_pk_orig_column_names || ') FROM ' ||
                   l_db_object_name || ', ego_item_cat_denorm_hier cathier WHERE  item_catalog_group_id = cathier.child_catalog_group_id AND ';
Line: 4705

      l_sub_pred_clause:=' UNION ALL  ( SELECT to_char(' ||
                   l_pk_orig_column_names || ') FROM ' ||
                   l_db_object_name || ' WHERE ';
Line: 4719

        ' SELECT DISTINCT instance_sets.predicate ' ||
          ' FROM fnd_grants grants, fnd_form_functions functions, ' ||
               ' fnd_menu_entries cmf, fnd_object_instance_sets instance_sets ' ||
         ' WHERE grants.instance_type = :instance_type ' ||
           ' AND grants.start_date <= SYSDATE ' ||
           ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
           ' AND cmf.function_id = functions.function_id ' ||
           ' AND cmf.menu_id = grants.menu_id ' ||
           ' AND grants.instance_set_id = instance_sets.instance_set_id ' ||
           ' AND grants.object_id = :object_id ' ||
           ' AND functions.function_name = :function ' ||
           ' AND ((grants.grantee_type = ''USER'' ' ||
                 ' AND grants.grantee_key = :grantee_key )' ||
                ' OR (grants.grantee_type = ''GROUP'' ' ||
                    ' AND grants.grantee_key in ( '||l_group_info||' ))' ||
                ' OR (grants.grantee_type = ''COMPANY'' ' ||
                    ' AND grants.grantee_key in ( '||l_company_info||' ))' ||
                ' OR (grants.grantee_type = ''GLOBAL'' ' ||
                    ' AND grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL''))) ';
Line: 5013

     SELECT DISTINCT instance_sets.predicate
       FROM fnd_grants grants,
            fnd_object_instance_sets instance_sets
      WHERE grants.instance_type = 'SET'
        AND grants.start_date <= SYSDATE
        AND (   grants.end_date IS NULL
             OR grants.end_date >= SYSDATE )
        AND grants.instance_set_id = instance_sets.instance_set_id
        AND grants.object_id = cp_parent_object_id
        AND ( grants.menu_id in
         ( SELECT p.parent_role_id
           FROM fnd_menu_entries r, fnd_form_functions f,
                fnd_menus m, ego_obj_role_mappings p
           WHERE  r.function_id = f.function_id
           AND r.menu_id = m.menu_id
           AND f.function_name = cp_function
           AND m.menu_id = p.child_role_id
           AND p.child_object_id = cp_object_id
           AND P.parent_object_id = cp_parent_object_id ))
        AND  (    (    grants.grantee_type = 'USER'
                   AND grants.grantee_key = cp_user_name)
               OR (    grants.grantee_type = 'GROUP'
                   AND grants.grantee_key in
                 (  cp_group_info ))
       OR (    grants.grantee_type = 'COMPANY'
           AND grants.grantee_key in
                  ( cp_company_info ))
               OR (grants.grantee_type = 'GLOBAL'
               AND grants.grantee_key in ('HZ_GLOBAL:-1000', 'GLOBAL') ));
Line: 5050

     SELECT DISTINCT p.parent_role_id
           FROM fnd_menu_entries r, fnd_form_functions f,
                fnd_menus m, ego_obj_role_mappings p
           WHERE  r.function_id = f.function_id
           AND r.menu_id = m.menu_id
           AND f.function_name = cp_function
           AND m.menu_id = p.child_role_id
           AND p.child_object_id = cp_object_id
           AND P.parent_object_id = cp_parent_object_id
           AND p.child_object_type = cp_object_type;
Line: 5067

     SELECT DISTINCT p.parent_role_id
           FROM fnd_menu_entries r, fnd_form_functions f,
                fnd_menus m, ego_obj_role_mappings p
           WHERE  r.function_id = f.function_id
           AND r.menu_id = m.menu_id
           AND f.function_name = cp_function
           AND m.menu_id = p.child_role_id
           AND p.child_object_id = cp_object_id
           AND P.parent_object_id = cp_parent_object_id;
Line: 5083

      select cm.menu_name from
      fnd_menus m, ego_obj_role_mappings r, fnd_menus cm
      where r.parent_role_id = m.menu_id and
      m.menu_name = cp_parent_role
      and r.parent_object_id = cp_parent_object_id
      and r.child_object_id = cp_child_object_id
      and r.child_object_type = cp_child_object_type
      and cm.MENU_ID = r.CHILD_ROLE_ID;
Line: 5369

         ' SELECT '||l_type_converted_val_cols ||
         ' FROM fnd_grants grants, ' ||
              ' fnd_form_functions functions, ' ||
              ' fnd_menu_entries cmf ';
Line: 5416

    l_sub_pred_clause:= ' UNION ALL  ( SELECT '
                     ||l_pk_orig_column_names || ' FROM ' ||
                     l_db_object_name ||
                     ' WHERE ' || l_pk_orig_column_names||'='||p_pk1_alias ||
                     ' and ';
Line: 5424

      ' SELECT DISTINCT instance_sets.predicate ' ||
        ' FROM fnd_grants grants, fnd_form_functions functions, ' ||
             ' fnd_menu_entries cmf, fnd_object_instance_sets instance_sets ' ||
       ' WHERE grants.instance_type = :instance_type ' ||
         ' AND grants.start_date <= SYSDATE ' ||
         ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
         ' AND cmf.function_id = functions.function_id ' ||
         ' AND cmf.menu_id = grants.menu_id ' ||
         ' AND grants.instance_set_id = instance_sets.instance_set_id ' ||
         ' AND grants.object_id = :object_id ' ||
         ' AND functions.function_name = :function ' ||
         ' AND ((grants.grantee_type = ''USER'' ' ||
               ' AND grants.grantee_key = :grantee_key )' ||
              ' OR (grants.grantee_type = ''GROUP'' ' ||
                  ' AND grants.grantee_key in ( '||l_group_info||' ))' ||
              ' OR (grants.grantee_type = ''COMPANY'' ' ||
                  ' AND grants.grantee_key in ( '||l_company_info||' ))' ||
              ' OR (grants.grantee_type = ''GLOBAL'' ' ||
                  ' AND grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL''))) ';
Line: 5485

        ' SELECT DISTINCT instance_sets.predicate '||
          ' FROM fnd_grants grants, '||
               ' fnd_object_instance_sets instance_sets,' ||
               ' fnd_form_functions F, fnd_menu_entries R, '||
               ' fnd_menus M, ego_obj_role_mappings P '||
        '  WHERE grants.instance_type = ''SET'' '||
           ' AND grants.start_date <= SYSDATE ' ||
           ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE '||
           ' AND grants.instance_set_id = instance_sets.instance_set_id '||
           ' AND instance_sets.object_id =  :parent_object_id ' ||
           ' AND grants.object_id =  :parent_object_id1 '  ||
           ' AND grants.menu_id = p.parent_role_id ' ||
           ' AND r.function_id = f.function_id '||
           ' AND r.menu_id = m.menu_id ' ||
           ' AND f.function_name = :function_id '||
           ' AND m.menu_id = p.child_role_id ' ||
           ' AND p.child_object_id = :child_object_id '||
           ' AND p.parent_object_id = :parent_object_id2 '||
           ' AND p.child_object_type = :child_object_type ' ||
           ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
                 ' grants.grantee_key = :user_name ) '||
                 ' OR (grants.grantee_type = ''GROUP'' AND '||
                 ' grants.grantee_key in ( '||l_group_info||' ))' ||
                 ' OR (grants.grantee_type = ''COMPANY'' AND '||
                 ' grants.grantee_key in ( '||l_company_info||' ))' ||
                 ' OR (grants.grantee_type = ''GLOBAL'' AND '||
                 ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') ))';
Line: 5579

                l_parent_predicate := l_parent_predicate || 'Select ' || l_pk_orig_column_names;
Line: 5633

          ' SELECT '||l_type_converted_val_cols ||
          ' FROM fnd_grants grants ';
Line: 5730

                    ' UNION ALL  ( SELECT ' ||l_pk_orig_column_names ||
                    ' FROM ' || l_db_object_name ||
                    ' WHERE ' || l_orig_pk_column || ' = ' || p_parent_obj_pk1alias_tbl(l_table_index)
                    , 1, g_pred_buf_size); */
Line: 5737

                    ' UNION ALL  ( SELECT ' ||l_pk_orig_column_names ||
                    ' FROM ' || l_db_object_name || ' , ego_item_cat_denorm_hier cathier '||
                    ' WHERE item_catalog_group_id = cathier.child_catalog_group_id AND ' || l_orig_pk_column || ' = ' || p_parent_obj_pk1alias_tbl(l_table_index)
                    , 1, g_pred_buf_size);
Line: 5744

                    ' UNION ALL  ( SELECT ' ||l_pk_orig_column_names ||
                    ' FROM ' || l_db_object_name ||
                    ' WHERE ' || l_orig_pk_column || ' = ' || p_parent_obj_pk1alias_tbl(l_table_index)
                    , 1, g_pred_buf_size);
Line: 5774

                                           ' UNION ALL  ( SELECT '
                                           ||l_pk_orig_column_names || ' FROM ' ||
                                           l_db_object_name || ' WHERE '
                                           || l_set_predicates ||  '))',
                                              1, g_pred_buf_size);
Line: 5914

                 'SELECT  '|| l_pk_column_names ||
                  ' FROM  '|| l_db_object_name ||
                 ' WHERE '||l_predicate||' ';
Line: 6063

      select s.predicate,
             o.database_object_name,
             o.pk1_column_name,
             o.pk2_column_name,
             o.pk3_column_name,
             o.pk4_column_name,
             o.pk5_column_name,
             o.pk1_column_type,
             o.pk2_column_type,
             o.pk3_column_type,
             o.pk4_column_type,
             o.pk5_column_type
        into l_predicate,
             l_object_name,
             l_pk1_col_name,
             l_pk2_col_name,
             l_pk3_col_name,
             l_pk4_col_name,
             l_pk5_col_name,
             l_pk1_col_type,
             l_pk2_col_type,
             l_pk3_col_type,
             l_pk4_col_type,
             l_pk5_col_type
        from fnd_objects o, fnd_object_instance_sets s
       where s.instance_set_name =  p_instance_set_name
         and s.object_id = o.object_id;
Line: 6116

      'SELECT ''X'' FROM sys.dual WHERE EXISTS (' ||
        'SELECT ''X'''||
         ' FROM  '|| l_object_name ||
        ' WHERE ';
Line: 6300

    INSERT INTO EGO_OBJ_ROLE_MAPPINGS
    (
       PARENT_OBJECT_ID
     , PARENT_ROLE_ID
     , CHILD_OBJECT_ID
     , CHILD_OBJECT_TYPE
     , CHILD_ROLE_ID
     , LAST_UPDATE_DATE
     , LAST_UPDATED_BY
     , CREATION_DATE
     , CREATED_BY
     , LAST_UPDATE_LOGIN
    )
    VALUES
    (
       l_parent_obj_id
     , l_parent_role_id
     , l_child_obj_id
     , p_child_object_type
     , l_child_role_id
     , l_Sysdate
     , l_owner
     , l_Sysdate
     , l_owner
     , FND_GLOBAL.Login_id
    );
Line: 6485

PROCEDURE Update_Role_Mapping(
         p_api_version                  IN   NUMBER
        ,p_parent_obj_name              IN   VARCHAR2
        ,p_parent_role_name             IN   VARCHAR2
        ,p_child_obj_name               IN   VARCHAR2
        ,p_child_object_type            IN   VARCHAR2
        ,p_child_role_name              IN   VARCHAR2
        ,p_owner                        IN   NUMBER
        ,p_init_msg_list                IN   VARCHAR2   :=  fnd_api.g_FALSE
        ,p_commit                       IN   VARCHAR2   :=  fnd_api.g_FALSE
        ,x_return_status                OUT  NOCOPY VARCHAR2
        ,x_errorcode                    OUT  NOCOPY NUMBER
        ,x_msg_count                    OUT  NOCOPY NUMBER
        ,x_msg_data                     OUT  NOCOPY VARCHAR2
) IS

    l_api_name           CONSTANT VARCHAR2(30)   := 'Update_Role_Mapping';
Line: 6536

      SAVEPOINT   Update_Role_Mapping_PUB;
Line: 6574

    UPDATE EGO_OBJ_ROLE_MAPPINGS
     SET
       CHILD_ROLE_ID     = l_child_role_id
     , LAST_UPDATE_DATE  = l_Sysdate
     , LAST_UPDATED_BY   = l_owner
     , LAST_UPDATE_LOGIN = l_curr_login_id
     WHERE
       PARENT_OBJECT_ID = l_parent_obj_id AND
       PARENT_ROLE_ID = l_parent_role_id AND
       CHILD_OBJECT_ID = l_child_obj_id AND
       CHILD_OBJECT_TYPE = p_child_object_type;
Line: 6586

    UPDATE EGO_OBJ_ROLE_MAPPINGS
      SET
        CHILD_ROLE_ID     = l_child_role_id
      , LAST_UPDATE_DATE  = l_Sysdate
      , LAST_UPDATED_BY   = l_owner
      , LAST_UPDATE_LOGIN = l_curr_login_id
      WHERE
        PARENT_OBJECT_ID = l_parent_obj_id AND
        PARENT_ROLE_ID = l_parent_role_id AND
        CHILD_OBJECT_ID = l_child_obj_id AND
        CHILD_OBJECT_TYPE is null;
Line: 6629

               ,p_module    => 'Update_Role_Mapping '
               ,p_message   => 'Returning 13 with params '||
                               ' x_return_status: '|| x_return_status||
                               ' - x_errorcode: '||x_errorcode||
                               ' - x_msg_count: '||x_msg_count||
                               ' - x_msg_data: '||x_msg_data
                );
Line: 6640

        ROLLBACK TO Update_Role_Mapping_PUB;
Line: 6658

        ROLLBACK TO Update_Role_Mapping_PUB;
Line: 6676

        ROLLBACK TO Update_Role_Mapping_PUB;
Line: 6701

END Update_Role_Mapping;
Line: 6706

PROCEDURE Update_Role_Mapping(
         p_api_version                  IN   NUMBER
        ,p_parent_obj_name              IN   VARCHAR2
        ,p_parent_role_name             IN   VARCHAR2
        ,p_child_obj_name               IN   VARCHAR2
        ,p_child_object_type            IN   VARCHAR2
        ,p_child_role_name              IN   VARCHAR2
        ,p_init_msg_list                IN   VARCHAR2   :=  fnd_api.g_FALSE
        ,p_commit                       IN   VARCHAR2   :=  fnd_api.g_FALSE
        ,x_return_status                OUT  NOCOPY VARCHAR2
        ,x_errorcode                    OUT  NOCOPY NUMBER
        ,x_msg_count                    OUT  NOCOPY NUMBER
        ,x_msg_data                     OUT  NOCOPY VARCHAR2
) IS

  BEGIN
    SetGlobals();
Line: 6724

               ,p_module    => 'Update_Role_Mapping'
               ,p_message   => 'Started with 12 params '||
                               ' p_api_version: '|| p_api_version||
                               ' - p_parent_obj_name: '||p_parent_obj_name||
                               ' - p_parent_role_name: '||p_parent_role_name||
                               ' - p_child_obj_name: '||p_child_obj_name||
                               ' - p_child_object_type: '||p_child_object_type||
                               ' - p_child_role_name: '||p_child_role_name||
                               ' - p_init_msg_list: '||p_init_msg_list||
                               ' - p_commit: '||p_commit
                );
Line: 6736

    Update_Role_Mapping(
         p_api_version                  => p_api_version
        ,p_parent_obj_name              => p_parent_obj_name
        ,p_parent_role_name             => p_parent_role_name
        ,p_child_obj_name               => p_child_obj_name
        ,p_child_object_type            => p_child_object_type
        ,p_child_role_name              => p_child_role_name
        ,p_owner                        => NULL
        ,p_init_msg_list                => p_init_msg_list
        ,p_commit                       => p_commit
        ,x_return_status                => x_return_status
        ,x_errorcode                    => x_errorcode
        ,x_msg_count                    => x_msg_count
        ,x_msg_data                     => x_msg_data
    );
Line: 6752

               ,p_module    => 'Update_Role_Mapping'
               ,p_message   => 'Returning 12 with params '||
                               ' x_return_status: '|| x_return_status||
                               ' - x_errorcode: '||x_errorcode||
                               ' - x_msg_count: '||x_msg_count||
                               ' - x_msg_data: '||x_msg_data
                );
Line: 6760

END Update_Role_Mapping;
Line: 6765

PROCEDURE Delete_Role_Mapping(
         p_api_version                  IN   NUMBER
        ,p_parent_obj_name              IN   VARCHAR2
        ,p_parent_role_name             IN   VARCHAR2
        ,p_child_obj_name               IN   VARCHAR2
        ,p_child_object_type            IN   VARCHAR2
        ,p_init_msg_list                IN   VARCHAR2   :=  fnd_api.g_FALSE
        ,p_commit                       IN   VARCHAR2   :=  fnd_api.g_FALSE
        ,x_return_status                OUT  NOCOPY VARCHAR2
        ,x_errorcode                    OUT  NOCOPY NUMBER
        ,x_msg_count                    OUT  NOCOPY NUMBER
        ,x_msg_data                     OUT  NOCOPY VARCHAR2
) IS

    l_api_name           CONSTANT VARCHAR2(30)   := 'Delete_Role_Mapping';
Line: 6811

      SAVEPOINT   Delete_Role_Mapping_PUB;
Line: 6841

        DELETE FROM EGO_OBJ_ROLE_MAPPINGS
        WHERE
        PARENT_OBJECT_ID = l_parent_obj_id AND
        PARENT_ROLE_ID = l_parent_role_id AND
        CHILD_OBJECT_ID = l_child_obj_id AND
        CHILD_OBJECT_TYPE = p_child_object_type;
Line: 6848

        DELETE FROM EGO_OBJ_ROLE_MAPPINGS
        WHERE
        PARENT_OBJECT_ID = l_parent_obj_id AND
        PARENT_ROLE_ID = l_parent_role_id AND
        CHILD_OBJECT_ID = l_child_obj_id AND
        CHILD_OBJECT_TYPE is null;
Line: 6887

        ROLLBACK TO Delete_Role_Mapping_PUB;
Line: 6905

        ROLLBACK TO Delete_Role_Mapping_PUB;
Line: 6923

        ROLLBACK TO Delete_Role_Mapping_PUB;
Line: 6948

END Delete_Role_Mapping;
Line: 6976

    SELECT functions.function_name
    FROM fnd_form_functions functions,
         fnd_menu_entries cmf,
       fnd_menus menus
    WHERE functions.function_id = cmf.function_id
    AND   menus.menu_id = cmf.menu_id
    AND   menus.menu_name = cp_role_name;
Line: 7068

    l_select_query_part        VARCHAR2(3000);
Line: 7223

      /*l_select_query_part:= 'SELECT '|| l_pk_column_names ||
                             ' FROM '|| l_db_object_name ||
                            ' WHERE ('; */
Line: 7227

  l_select_query_part:= 'SELECT '|| l_pk_column_names ||
                              ' FROM '|| l_db_object_name ||', ego_item_cat_denorm_hier cathier'||
                              ' WHERE (';
Line: 7231

        l_select_query_part:= 'SELECT '|| l_pk_column_names ||
                              ' FROM '|| l_db_object_name ||
                              ' WHERE (';
Line: 7237

        l_select_query_part := l_select_query_part || l_db_pk1_column;
Line: 7240

        l_select_query_part := l_select_query_part || ',' || l_db_pk2_column;
Line: 7243

        l_select_query_part := l_select_query_part || ',' || l_db_pk3_column;
Line: 7246

        l_select_query_part := l_select_query_part  || ',' || l_db_pk4_column;
Line: 7249

        l_select_query_part := l_select_query_part || ',' || l_db_pk5_column;
Line: 7254

      l_select_query_part := l_select_query_part || ') ';
Line: 7255

      l_select_query_part := l_select_query_part ||' IN ' ||
                       ' (' || p_parent_object_sql_tbl (l_table_index) || ') ';
Line: 7259

      /*l_select_query_part := l_select_query_part || ' AND ';*/
Line: 7261

         l_select_query_part := l_select_query_part || ' AND item_catalog_group_id = cathier.child_catalog_group_id AND ';
Line: 7263

         l_select_query_part := l_select_query_part || ' AND ';
Line: 7269

                 ,p_message   => l_select_query_part
                 );
Line: 7278

      ' SELECT DISTINCT sets.instance_set_id, sets.predicate ' ||
        ' FROM fnd_grants grants, fnd_object_instance_sets sets' ||
       ' WHERE grants.object_id = :object_id ' ||
         ' AND grants.start_date <= SYSDATE ' ||
         ' AND NVL(grants.end_date, SYSDATE) >= SYSDATE ' ||
         ' AND grants.instance_type = :instance_type ' ||
          ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
                 ' grants.grantee_key = :user_name ) '||
                 ' OR (grants.grantee_type = ''GROUP'' AND '||
                 ' grants.grantee_key in ( '||l_group_info||' ))' ||
                 ' OR (grants.grantee_type = ''COMPANY'' AND '||
                 ' grants.grantee_key in ( '||l_company_info||' ))' ||
                 ' OR (grants.grantee_type = ''GLOBAL'' AND '||
                 ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )) '||
         ' AND sets.instance_set_id = grants.instance_set_id ' ||
         ' AND sets.object_id = grants.object_id ';
Line: 7310

        l_dynamic_sql := l_select_query_part ||
                         ' (' ||  l_one_set_predicate || ') ';
Line: 7336

        'SELECT DISTINCT fnd_functions.function_name ' ||
         ' FROM fnd_grants grants, ' ||
              ' fnd_form_functions fnd_functions, ' ||
              ' fnd_menu_entries cmf, '||
              ' ego_obj_role_mappings mapping '||
        ' WHERE grants.object_id = :object_id '||
          ' AND grants.start_date <= SYSDATE '||
          ' AND NVL(grants.end_date,SYSDATE) >= SYSDATE ' ||
          ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
                 ' grants.grantee_key = :user_name ) '||
              ' OR (grants.grantee_type = ''GROUP'' AND ' ||
                  ' grants.grantee_key in ( '||l_group_info||' )) ' ||
              ' OR (grants.grantee_type = ''COMPANY'' AND ' ||
                  ' grants.grantee_key in ( '||l_company_info||' )) ' ||
              ' OR (grants.grantee_type = ''GLOBAL'' AND ' ||
                  ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') ))'||
          ' AND mapping.child_role_id = cmf.menu_id ' ||
          ' AND mapping.parent_role_id = grants.menu_id ' ||
          ' AND mapping.child_object_id = :child_object_id ' ||
          ' AND mapping.parent_object_id = :parent_object_id ' ||
          ' AND mapping.child_object_type = :object_type ' ||
          ' AND cmf.function_id = fnd_functions.function_id ';
Line: 7425

           ' SELECT DISTINCT fnd_functions.function_name ' ||
             ' FROM  fnd_form_functions fnd_functions, ' ||
                   ' fnd_menu_entries cmf, ' ||
                   ' ego_obj_role_mappings mapping, ' ||
                   ' fnd_menus  menus ' ||
             ' WHERE menus.menu_name = :profile_role ' ||
               ' AND mapping.parent_role_id = menus.menu_id ' ||
               ' AND mapping.child_role_id = cmf.menu_id  ' ||
               ' AND mapping.child_object_id =  :profile_object_id ' ||
               ' AND mapping.parent_object_id = :profile_parent_object_id ' ||
               ' AND mapping.child_object_type = :profile_object_type ' ||
               ' AND cmf.function_id = fnd_functions.function_id ';
Line: 7727

    select p.parent_role_id parent_role_id
      from fnd_menu_entries r, fnd_form_functions f,
           fnd_menus m, ego_obj_role_mappings p
     where r.function_id       = f.function_id
       and r.menu_id           = m.menu_id
       and f.function_name     = cp_function
       and m.menu_id           = p.child_role_id
       and p.child_object_id   = cp_object_id
       and p.parent_object_id  = cp_parent_object_id
       and p.child_object_type = cp_object_type;
Line: 7945

      'SELECT ''X'' ' ||
       ' FROM fnd_grants grants ' ||
      ' WHERE grants.object_id = :object_id ' ||
        ' AND grants.start_date <= SYSDATE '||
        ' AND NVL(grants.end_date, SYSDATE) >= SYSDATE ' ||
        ' AND grants.instance_type = :instance_type ' ||
        ' AND ' || l_pk_values_string ||
        ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
               ' grants.grantee_key = :user_name ) '||
               ' OR ( grants.grantee_type = ''GROUP'' AND '||
               ' grants.grantee_key in ( '||l_group_info||' ))' ||
               ' OR ( grants.grantee_type = ''COMPANY'' AND '||
               ' grants.grantee_key in ( '||l_company_info||' ))' ||
               ' OR (grants.grantee_type = ''GLOBAL'' AND '||
               ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )) '||
        ' AND grants.menu_id IN (' || l_menu_info ||') ';
Line: 7991

       ' SELECT DISTINCT instance_sets.predicate ' ||
         ' FROM fnd_grants grants, fnd_object_instance_sets instance_sets ' ||
        ' WHERE grants.instance_type = :instance_type '||
          ' AND grants.start_date <= SYSDATE ' ||
          ' AND (grants.end_date IS NULL OR grants.end_date >= SYSDATE) ' ||
          ' AND grants.instance_set_id = instance_sets.instance_set_id ' ||
          ' AND grants.object_id = :parent_object_id '||
          ' AND ( ( grants.grantee_type = ''USER'' AND ' ||
               ' grants.grantee_key = :user_name ) '||
               ' OR ( grants.grantee_type = ''GROUP'' AND '||
               ' grants.grantee_key in ( '||l_group_info||' ))' ||
               ' OR ( grants.grantee_type = ''COMPANY'' AND '||
               ' grants.grantee_key in ( '||l_company_info||' ))' ||
               ' OR (grants.grantee_type = ''GLOBAL'' AND '||
               ' grants.grantee_key in (''HZ_GLOBAL:-1000'', ''GLOBAL'') )) '||
          ' AND grants.menu_id in (' || l_menu_info || ')';
Line: 8050

          'SELECT ''X'' '||
           ' FROM '|| l_db_object_name ||
          ' WHERE (';