标签:
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;
标签:
原文地址:http://www.cnblogs.com/quanweiru/p/4869884.html