select pro.profile_option_name,
pro.user_profile_option_name,
lev.level_type type,
--lev.level_code,
lev.level_name,
prv.profile_option_value
from apps.fnd_profile_options_vl pro,
applsys.fnd_profile_option_values prv,
(select 10001 level_id,
'Site' level_type,
0 level_value,
'Site' level_code,
'Site' level_name
from dual
union all
select 10002 level_id,
'App' level_type,
app.application_id level_value,
app.application_short_name level_code,
app.application_name level_name
from apps.fnd_application_vl app
union all
select 10003 level_id,
'Resp' level_type,
resp.responsibility_id level_value,
resp.responsibility_key level_code,
resp.responsibility_name level_name
from apps.fnd_responsibility_vl resp
union all
select 10004 level_id,
'User' level_type,
usr.user_id level_value,
usr.user_name level_code,
usr.user_name level_name
from applsys.fnd_user usr) lev
where pro.profile_option_id = prv.profile_option_id(+)
and prv.level_id = lev.level_id(+)
and prv.level_value = lev.level_value(+)
and pro.user_profile_option_name like 'KW%' --Profile名称
order by pro.profile_option_name, lev.level_type, lev.level_name;
本文介绍了一个复杂的SQL查询,用于从Oracle数据库中获取profile选项与不同层级类型(如Site、App、Resp和User)之间的关联。通过联接多个表,包括fnd_profile_options_vl、fnd_profile_option_values和一个自定义的level类型表,此查询展示了如何根据特定条件筛选和组织数据。
568

被折叠的 条评论
为什么被折叠?



