当前职责可访问的OU(MO:安全性配置文件)

--初始化环境
BEGIN
  fnd_global.apps_initialize(user_id      => 0,
                             resp_id      => 50658,
                             resp_appl_id => 20003);
  mo_global.set_policy_context(p_access_mode => 'S', p_org_id => 82);
  mo_global.init('SQLAP');
END;

--以下SQL查询当前配置的MO:安全性配置文件
SELECT *
  FROM per_security_profiles psp
 WHERE psp.security_profile_id =

       to_number(fnd_profile.value('XLA_MO_SECURITY_PROFILE_LEVEL'));

和fnd_profile.value('ORG_ID') 来配置


--以下SQL用来获取当前安全性配置文件和当前用户可访问的OU
SELECT hou.organization_id, hou.name
  FROM hr_operating_units hou
 WHERE hou.usable_flag IS NULL
   AND EXISTS
 (SELECT 1
          FROM per_organization_list per
         WHERE per.organization_id = hou.organization_id
           AND per.security_profile_id =
               to_number(fnd_profile.value('XLA_MO_SECURITY_PROFILE_LEVEL'))
        UNION
        SELECT 1
          FROM dual
         WHERE to_number(fnd_profile.value('ORG_ID')) = hou.organization_id)


你可能感兴趣的:(ORACLE,EBS,SQL)