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 (+)--parameter profile, under which a condition can be used
And pro.user_profile_option_name like '% '--profile name
ORDER by Pro.profile_option_name,
Lev.level_type, Lev.level_name;