DBA Data[Home] [Help]

APPS.IGS_SC_GRANTS_PVT SQL Statements

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

Line: 96

PROCEDURE insert_user_attrib(
  p_user_id          IN NUMBER  ,
  p_party_id         IN NUMBER ,
  p_user_attrib_id   IN NUMBER  ,
  p_user_attrib_name IN VARCHAR2,
  p_user_attrib_type IN VARCHAR2,
  p_static_type      IN VARCHAR2,
  p_select_text      IN VARCHAR2
);
Line: 300

  p_select_text VARCHAR2)
RETURN BOOLEAN IS
 l_api_name       CONSTANT VARCHAR2(30)   := 'CHECK_GRANT_TEXT';
Line: 304

 l_select_text VARCHAR(32000);
Line: 308

       l_debug_str := 'Table Name: '||p_table_name||','||'Select Text: '||p_select_text;
Line: 312

   l_select_text := replace_string(ltrim(p_select_text),':PARTY_ID','igs_sc_vars.get_partyid');
Line: 314

   l_select_text := replace_string(ltrim(l_select_text),':USER_ID','igs_sc_vars.get_userid');
Line: 316

   l_select_text := replace_string(ltrim(l_select_text),':TBL_ALIAS','tstal');
Line: 320

       l_debug_str := 'Final Select: '||'SELECT 1 FROM ('||' SELECT 1 FROM '||p_table_name||' WHERE '||l_select_text||' )';
Line: 326

    EXECUTE IMMEDIATE 'SELECT 1 FROM ('||' SELECT 1 FROM '||p_table_name||' WHERE '||l_select_text||' )' ;
Line: 376

    SELECT sco.obj_group_id,
           sco.object_id,
           fnd.obj_name,
           grp.default_policy_type,
           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
      FROM igs_sc_objects sco,
           fnd_objects fnd,
           igs_sc_grants grn,
           igs_sc_obj_groups grp
     WHERE  (application_id  IN (8405,8406))
            AND fnd.object_id = sco.object_id
            AND sco.obj_group_id = grn.obj_group_id
            AND grn.grant_id = cp_grant_id
            AND grp.obj_group_id = grn.obj_group_id
	    AND sco.active_flag = 'Y';
Line: 405

     SELECT grant_id,
            grant_text
       FROM igs_sc_grants gr
      WHERE grant_id = p_grant_id;
Line: 623

  l_attr_select  VARCHAR2(4000);
Line: 624

  l_usr_select   VARCHAR2(4000);
Line: 625

  l_obj_select   VARCHAR2(4000);
Line: 639

    SELECT grant_where
      FROM igs_sc_obj_grants
     WHERE object_id = s_obj_id
           AND grant_id = s_grant_id;
Line: 646

    SELECT grant_id,
           grant_cond_num,
           obj_attrib_id,
           user_attrib_id,
           condition,
           text_value
      FROM igs_sc_grant_conds
     WHERE grant_id = s_grant_id;
Line: 656

    SELECT *
      FROM igs_sc_usr_attribs
     WHERE user_attrib_id = s_attrib_id;
Line: 661

    SELECT *
      FROM igs_sc_obj_att_mths
     WHERE obj_attrib_id = s_attrib_id
           AND object_id = s_object_id;
Line: 726

     l_obj_select := '';
Line: 727

     l_usr_select := '';
Line: 774

         l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text := l_obj_attrib.select_text||' ';
Line: 780

         l_obj_const := l_obj_attrib.select_text;
Line: 786

         l_obj_select := replace_string(ltrim(l_obj_attrib.select_text),':TBL_ALIAS',l_obj_alias);
Line: 799

         l_part_grant2 := ') IN ( SELECT '||l_alias_name||'.pk1_value';
Line: 881

         l_attr_select := replace_string(ltrim(l_user_attrib.select_text),':PARTY_ID','igs_sc_vars.get_partyid');
Line: 883

         l_attr_select := replace_string(ltrim(l_attr_select),':USER_ID','igs_sc_vars.get_userid');
Line: 887

         l_usr_select := replace_string(ltrim(l_attr_select),':TBL_ALIAS',l_usr_alias);
Line: 892

         l_attr_select := replace_string(ltrim(l_user_attrib.select_text),':PARTY_ID','igs_sc_vars.get_partyid');
Line: 894

         l_usr_const := replace_string(ltrim(l_attr_select),':USER_ID','igs_sc_vars.get_userid');
Line: 901

         l_usr_select :='SELECT '||l_usr_alias||'.attr_value FROM igs_sc_usr_att_vals '||l_usr_alias||' WHERE '||l_usr_alias||'.user_id=igs_sc_vars.get_userid AND '
             ||l_usr_alias||'.user_attrib_id='||c_grant_cond_rec.user_attrib_id;
Line: 925

     IF l_obj_select IS NULL THEN
--        --code added my mmkumar
          IF l_obj_attrib.NULL_ALLOW_FLAG = 'Z' THEN
	       --IF isSingleGrantCond(p_grants_rec.grant_text) THEN
	       IF onlyZTypeAttributes THEN
                    l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text := l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text||' 1=1 ';
Line: 936

	         l_label := 'igs.plsql.igs_sc_grants_pvt.build_grant.Obj_select_1';
Line: 937

		 l_debug_str := ' Object select NULL, and Z type attrib. Condition text '||l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text ;
Line: 945

               IF  l_obj_const IS NOT NULL AND l_usr_select IS NOT NULL THEN
                    -- User attribute is select of any kind and object attribute is not select
		    -- User Select = Obj CONST
                    l_found_pos := INSTR(UPPER(ltrim(l_usr_select)),'FROM',1,1);
Line: 949

                    l_column_name := substr(ltrim(l_usr_select),8,l_found_pos-9); -- 8 position 'select ' found -9 ' FROM'
Line: 954

                         ||' EXISTS ('||l_usr_select||' AND '||l_column_name||' '||check_operation(l_grant_cond(c_grant_cond_rec.grant_cond_num).condition)||' '||l_obj_const||' )';
Line: 956

               ELSIF l_obj_const IS NULL  AND l_usr_select IS NOT NULL THEN
                    -- Colunmn name = User Select
                    IF l_obj_attrib.NULL_ALLOW_FLAG = 'Y' THEN -- Nullable column
	                 l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text := '('||l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text||' '||
                         l_grant_cond(c_grant_cond_rec.grant_cond_num).condition ||' (' ||l_usr_select||') OR '||l_table_column ||' IS NULL) '||l_post_grant;
Line: 963

                         l_grant_cond(c_grant_cond_rec.grant_cond_num).condition ||' (' ||l_usr_select||')'||l_post_grant;
Line: 965

               ELSIF  l_obj_const IS NULL  AND l_usr_select IS NULL THEN
                    -- Column name = User CONST
                    IF l_obj_attrib.NULL_ALLOW_FLAG = 'Y' THEN -- Nullable column
                         l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text := '('||l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text||' '||
                         l_obj_const||' '||l_grant_cond(c_grant_cond_rec.grant_cond_num).condition||' '||l_usr_const||' OR '||l_table_column ||' IS NULL)'||l_post_grant;
Line: 982

	         l_label := 'igs.plsql.igs_sc_grants_pvt.build_grant.Obj_select_2';
Line: 983

		 l_debug_str := ' Object select is NULL. Non Z. Grant condition text '||l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text ;
Line: 987

     ELSE --Object select is not null

          -- we need to change select so we'll have 2 select statments


          --find the name of the select coulmn for attribute
          l_found_pos := INSTR(UPPER(ltrim(l_obj_select)),'FROM',1,1);
Line: 994

          l_column_name := substr(ltrim(l_obj_select),8,l_found_pos-9); -- 8 position 'select ' found -9 ' FROM'
Line: 1007

	         l_label := 'igs.plsql.igs_sc_grants_pvt.build_grant.Obj_select_3';
Line: 1008

		 l_debug_str := ' Object select NOT NULL, and Z type attrib. Condition text '||l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text ;
Line: 1015

               IF l_usr_select IS NOT NULL THEN
                    --Add user select
                    l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text := l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text||' EXISTS ('||l_obj_select||' AND '||l_column_name||' '||
                    l_grant_cond(c_grant_cond_rec.grant_cond_num).condition||' ('||l_usr_select||' )';
Line: 1022

                         l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text := l_obj_select;
Line: 1024

                         l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text := l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text||' EXISTS ('||l_obj_select||' AND '||l_column_name||' '||
                         l_grant_cond(c_grant_cond_rec.grant_cond_num).condition||' '||l_usr_const;
Line: 1030

                    l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text :=  l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text||' OR NOT EXISTS (' ||l_obj_select||'))';
Line: 1036

	         l_label := 'igs.plsql.igs_sc_grants_pvt.build_grant.Obj_select_4';
Line: 1037

		 l_debug_str := ' Object select NOT NULL, and Non Z type attrib. Condition text '||l_grant_cond(c_grant_cond_rec.grant_cond_num).cond_text ;
Line: 1161

      DELETE FROM igs_sc_obj_grants
       WHERE object_id = p_group_rec.object_id AND grant_id = p_grants_rec.grant_id;
Line: 1172

     INSERT INTO igs_sc_obj_grants (
           grant_id,
           object_id,
           grant_where,
           creation_date,
           created_by,
           last_updated_by,
           last_update_date,
           last_update_login)
         VALUES (
           p_grants_rec.grant_id,
           p_group_rec.object_id,
           l_statment,
           SYSDATE,
           NVL(FND_GLOBAL.user_id,-1),
           NVL(FND_GLOBAL.user_id,-1),
           SYSDATE,
           NVL(FND_GLOBAL.login_id, -1) ) ;
Line: 1218

    SELECT sco.obj_group_id,
           sco.object_id,
           fnd.obj_name,
           grp.default_policy_type,
           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
      FROM igs_sc_objects sco,
           fnd_objects fnd,
           igs_sc_obj_groups grp
     WHERE  application_id  IN (8405,8406)
            AND fnd.obj_name = cp_obj_name
            AND grp.obj_group_id = sco.obj_group_id
            AND fnd.object_id = sco.object_id;
Line: 1243

     SELECT gr.grant_id,
            objgr.grant_where
       FROM igs_sc_grants gr,
            igs_sc_obj_grants objgr,
            wf_local_user_roles rls
      WHERE rls.user_orig_system =g_user_orig_system
            AND rls.user_orig_system_id = s_user_id
            AND rls.role_orig_system = 'IGS'
            AND rls.role_orig_system_id = gr.user_group_id
            AND objgr.object_id = s_object_id
            AND objgr.grant_id = gr.grant_id
            AND SYSDATE BETWEEN NVL(rls.start_date,sysdate-1) AND NVL(rls.expiration_date,sysdate+1)
            AND gr.obj_group_id = s_group_id
            AND gr.locked_flag ='Y'
            AND decode(p_function_type,'S',gr.grant_select_flag,'I',gr.grant_insert_flag,'D',gr.grant_delete_flag,'U',gr.grant_update_flag,'N')='Y';
Line: 1260

     SELECT objgr.grant_where
       FROM igs_sc_grants gr,
            igs_sc_obj_grants objgr
      WHERE objgr.object_id = s_object_id
            AND objgr.grant_id = gr.grant_id
            AND gr.obj_group_id = s_group_id
            AND gr.locked_flag ='Y'
            AND upper(gr.grant_name)='DEFAULT';
Line: 1382

			||l_user_id||','||'Final Select: '||l_statment;
Line: 1417

    SELECT user_attrib_id   ,
           user_attrib_name ,
           user_attrib_type ,
           static_type      ,
           select_text
      FROM igs_sc_usr_attribs
     WHERE user_attrib_id = p_attrib_id
           OR ( p_attrib_id IS NULL AND
                (static_type = 'S'
                  OR (static_type = 'C' AND p_all_attribs = 'Y') )
              )
              ORDER BY user_attrib_id;
Line: 1431

    SELECT user_attrib_id   ,
           user_attrib_name ,
           user_attrib_type ,
           static_type      ,
           select_text
      FROM igs_sc_usr_attribs
     WHERE user_attrib_id = p_attrib_id;
Line: 1441

	SELECT user_orig_system_id user_id
	FROM wf_local_user_roles rls
	WHERE rls.user_orig_system = 'FND_USR'
	AND rls.role_orig_system = 'IGS'
	AND (rls.EXPIRATION_DATE IS NULL OR rls.EXPIRATION_DATE > SYSDATE)
	AND rls.parent_orig_system = 'IGS'
	AND rls.parent_orig_system_id = rls.role_orig_system_id
	AND rls.partition_id = 0;
Line: 1452

    SELECT attr_value
      FROM igs_sc_usr_att_vals
     WHERE user_attrib_id = 1
           AND user_id = s_user_id;
Line: 1504

       insert_user_attrib(
         p_user_id          => l_user_id  ,
         p_party_id         => l_party_id ,
         p_user_attrib_id   => c_attrib_rec.user_attrib_id  ,
         p_user_attrib_name => c_attrib_rec.user_attrib_name  ,
         p_user_attrib_type => c_attrib_rec.user_attrib_type  ,
         p_static_type      => c_attrib_rec.static_type  ,
         p_select_text      => c_attrib_rec.select_text  );
Line: 1601

PROCEDURE insert_user_attrib(
  p_user_id          IN NUMBER  ,
  p_party_id         IN NUMBER ,
  p_user_attrib_id   IN NUMBER  ,
  p_user_attrib_name IN VARCHAR2,
  p_user_attrib_type IN VARCHAR2,
  p_static_type      IN VARCHAR2,
  p_select_text      IN VARCHAR2
) IS

 l_select        VARCHAR2(32000);
Line: 1612

 l_select_text   VARCHAR2(2000);
Line: 1620

  DELETE FROM igs_sc_usr_att_vals
     WHERE user_id = p_user_id
           AND user_attrib_id = p_user_attrib_id;
Line: 1624

  l_select := 'INSERT INTO igs_sc_usr_att_vals (USER_ID,USER_ATTRIB_ID,CREATION_DATE,CREATED_BY,LAST_UPDATED_BY,LAST_UPDATE_DATE,ATTR_VALUE )';
Line: 1629

  l_select_text := replace_string(ltrim(p_select_text),':PARTY_ID','IGS_SC_GRANTS_PVT.get_current_party');
Line: 1631

  l_select_text := replace_string(ltrim(l_select_text),':USER_ID','IGS_SC_GRANTS_PVT.get_current_user');
Line: 1635

  l_select_text := replace_string(ltrim(l_select_text),':TBL_ALIAS','sc'||p_user_attrib_id||'u');
Line: 1644

    l_select := l_select||' SELECT :V1, :V2, sysdate , -1 , -1, sysdate ,'||l_select_text||' FROM dual ';
Line: 1646

  ELSE  --Select of M-valued
    -- Remove all spaces from text and remove SELECT word from a text

    l_select := l_select||' SELECT :V1, :V2, sysdate , -1 , -1, sysdate ,'||substr(l_select_text,7,32000);
Line: 1653

  Put_Log_Msg ('Executed text is: '||IGS_SC_GRANTS_PVT.get_current_user||' : '||IGS_SC_GRANTS_PVT.get_current_party||':'|| l_select ,0);
Line: 1656

  EXECUTE IMMEDIATE l_select USING p_user_id,p_user_attrib_id;
Line: 1658

END insert_user_attrib;
Line: 1769

    SELECT grant_id
    FROM igs_sc_grants
     WHERE ( obj_group_id = p_obj_group_id  OR p_obj_group_id IS NULL)
           AND locked_flag ='Y';
Line: 1817

    UPDATE igs_sc_obj_groups
      SET default_policy_type = 'G';
Line: 1883

    SELECT grant_id
    FROM igs_sc_grants
     WHERE ( obj_group_id = p_obj_group_id  OR p_obj_group_id IS NULL)
           AND locked_flag = 'N';
Line: 2050

  p_select_text VARCHAR2,
  p_obj_attrib_type VARCHAR2 )

RETURN BOOLEAN IS
 l_select_text VARCHAR2(32000);
Line: 2058

     l_debug_str := 'Table Name: '||p_table_name||','||'Select Text: '||p_select_text||','||'Object Attribute Type: '||p_obj_attrib_type;
Line: 2064

   l_select_text :=  ' EXISTS ( SELECT '||p_select_text||' FROM DUAL ) ';
Line: 2068

   l_select_text :=  p_select_text||' IS NOT NULL ';
Line: 2072

   l_select_text := ' EXISTS ( '||p_select_text||' )';
Line: 2076

  RETURN check_grant_text ( p_table_name, l_select_text );