You are on page 1of 2

SELECT DISTINCT doc_name, obj.obj_name folder_name, bas.

ba_name, (SELECT user_na


me
FROM fnd_user where to_char(USER_ID) = SUBSTR (DOC.DOC_CREATED_BY, 2, 4)) OWNER
from EUL_US.EUL5_DOCUMENTS DOC,
EUL_US.EUL5_ELEM_XREFS XREF,
EUL_US.EUL5_EXPRESSIONS EXP,
EUL_US.EUL5_OBJS OBJ,
EUL_US.EUL5_BA_OBJ_LINKS BOL,
EUL_US.eul5_bas bas
WHERE xref.ex_from_id = doc.doc_id
AND xref.ex_to_id = EXP.exp_id
AND obj.obj_id = EXP.it_obj_id
AND bol.bol_obj_id = obj.obj_id
and BAS.BA_ID = BOL.BOL_BA_ID
--and BAS.BA_NAME like %Business Area%

new query 14 jan 2015

SELECT DISTINCT disco_docs.doc_name "Discoverer Workbook",


TRUNC (disco_docs.doc_created_date) "Workbook Create Date",
CASE
WHEN INSTR
(disco_docs.doc_created_by,
'#'
) = 0
THEN disco_docs.doc_created_by
WHEN INSTR (disco_docs.doc_created_by, '#') > 0
AND INSTR (disco_docs.doc_created_by, '#', 2) = 0
THEN (SELECT fu.user_name
FROM fnd_user fu
WHERE fu.user_id =
SUBSTR (disco_docs.doc_created_by, 2, 5))
ELSE NULL
END "Workbook Owner/Creator",
disco_users.eu_username,
CASE
WHEN INSTR
(disco_users.eu_username,
'#'
) = 0
THEN disco_users.eu_username
WHEN INSTR (disco_users.eu_username, '#') > 0
AND INSTR (disco_users.eu_username, '#', 2) = 0
THEN (SELECT fu.user_name
FROM fnd_user fu
WHERE fu.user_id =
SUBSTR (disco_users.eu_username, 2, 5))
ELSE (SELECT resp.responsibility_name
FROM fnd_responsibility_tl resp
WHERE resp.responsibility_id =
SUBSTR (disco_users.eu_username, 2, 5))
END AS "Shared Name / Responsibility"
FROM EUL_US.eul5_documents disco_docs,
EUL_US.eul5_access_privs disco_shares,
EUL_US.eul5_eul_users disco_users
WHERE disco_docs.doc_id = disco_shares.gd_doc_id
AND disco_users.eu_username(+) NOT IN ('EUL5', 'PUBLIC')
AND disco_users.eu_id(+) = disco_shares.ap_eu_id
AND disco_docs.doc_name LIKE '%Service%Contract%Renewal%';
To find Business folders
===============================================================
SELECT DISTINCT EB.BA_NAME "CUSTOM BUSINESS AREA" ,
EO.OBJ_NAME "CUSTOM FOLDER"
FROM EUL_US.EUL5_BAS EB ,
EUL_US.EUL5_OBJS EO ,
EUL_US.EUL5_BA_OBJ_LINKS EBOL ,
EUL_US.EUL5_EXPRESSIONS EE
WHERE EBOL.BOL_BA_ID = EB.BA_ID
AND EBOL.BOL_OBJ_ID = EO.OBJ_ID
AND EE.IT_OBJ_ID = EO.OBJ_ID
AND UPPER(EO.OBJ_NAME) LIKE '%STR%'
ORDER BY 1