Query to get child Request id for Request set
SELECT req.*
FROM
(SELECT con.user_concurrent_program_name
,req.request_id
,req.phase_code
,req.status_code
,parent_request_id
FROM fnd_concurrent_requests req
,fnd_concurrent_programs_vl con
WHERE 1 = 1
AND con.concurrent_program_id = req.concurrent_program_id
) req_set,
(SELECT con.user_concurrent_program_name
,req.request_id
,req.phase_code
,req.request_date
,req.requested_start_date
,req.actual_completion_date
,req.status_code, parent_request_id
FROM fnd_concurrent_requests req
,fnd_concurrent_programs_vl con
WHERE 1 = 1
AND con.concurrent_program_id = req.concurrent_program_id
) req
WHERE req_set.parent_request_id = 160454035 -- Request id of the submitted request set.
AND req.parent_request_id = req_set.request_id
order by requested_start_date desc
--Query to find the executable name associated with the concurrent program
--input: Concurrent Program Name
SELECT fcpv.user_concurrent_program_name concurrent_program_name
,fe.execution_file_name source_name
,fl.meaning program_type
FROM apps.fnd_concurrent_programs_vl fcpv
,apps.fnd_executables fe
,apps.fnd_lookups fl
WHERE fe.executable_id=fcpv.executable_id
AND fl.lookup_type='CP_EXECUTION_METHOD_CODE'
AND fl.lookup_code=fe.execution_method_code
AND fcpv.user_concurrent_program_name like 'Refresh iSupport Materialized View'
--Query to find the concurrent program associated with an executable
--input: Executable name
SELECT fcpv.user_concurrent_program_name concurrent_program_name
,fe.execution_file_name source_name
,fl.meaning program_type
FROM apps.fnd_concurrent_programs_vl fcpv
,apps.fnd_executables fe
,apps.fnd_lookups fl
WHERE fe.executable_id=fcpv.executable_id
AND fl.lookup_type='CP_EXECUTION_METHOD_CODE'
AND fl.lookup_code=fe.execution_method_code
AND fe.execution_file_name like '%'||:Executable_Name||'%'
--Query to find the Request groups to which a Concurrent Program is associated with
--input: Concurrent Program Name
SELECT frg.request_group_name
FROM apps.fnd_request_group_units frgu
,apps.fnd_request_groups frg
,apps.fnd_concurrent_programs_tl fcpt
WHERE frgu.request_group_id = frg.request_group_id
AND fcpt.concurrent_program_id = frgu.REQUEST_UNIT_ID
AND fcpt.user_concurrent_program_name like '%'||:Program_Name||'%'
--Query to find the responsibilities which can run the concurrent program
--input: Concurrent Program name
SELECT frv.responsibility_name
FROM apps.fnd_request_group_units frgu
,apps.fnd_responsibility_vl frv
,apps.fnd_concurrent_programs_vl fcpv
WHERE frv.REQUEST_GROUP_ID=frgu.REQUEST_GROUP_ID
AND fcpv.concurrent_program_id=frgu.REQUEST_UNIT_ID
AND nvl(frv.end_date,sysdate+1)>sysdate
AND EXISTS(
SELECT 'Y'
FROM apps.fnd_user_resp_groups grps
WHERE grps.responsibility_id=frv.responsibility_id
AND nvl(grps.end_date,sysdate+1)>sysdate
)
AND fcpv.user_concurrent_program_name like '%'||:Program_Name||'%'
--Query to find the last run date of a Concurrent Program
--input: Concurrent Program name
SELECT max(fcr.REQUEST_DATE)
FROM fnd_concurrent_requests fcr
,fnd_concurrent_programs_tl fcpt
WHERE fcr.concurrent_program_id = fcpt.concurrent_program_id
AND fcr.program_application_id = fcpt.application_id
AND fcr.actual_start_date > SYSDATE - :days_to_check
AND fcpt.user_concurrent_program_name like '%'||:Program_Name||'%'
--Query to find the last successful run date of a Concurrent Program
--input: Concurrent Program name
SELECT max(fcr.REQUEST_DATE) last_successfull_run_date
FROM fnd_concurrent_requests fcr
,fnd_concurrent_programs_tl fcpt
WHERE fcr.concurrent_program_id = fcpt.concurrent_program_id
AND fcr.program_application_id = fcpt.application_id
AND fcr.status_code in ('C','I','R')
AND fcr.phase_code = 'C'
AND fcr.actual_start_date > SYSDATE - :days_to_check
AND fcpt.user_concurrent_program_name like '%'||:Program_Name||'%'
--Query to find the last successful run date of a Concurrent Program
--input: Concurrent Program name
SELECT max(fcr.REQUEST_DATE) LAST_ERRORED_RUN_DATE
FROM fnd_concurrent_requests fcr
,fnd_concurrent_programs_tl fcpt
WHERE fcr.concurrent_program_id = fcpt.concurrent_program_id
AND fcr.program_application_id = fcpt.application_id
AND fcr.status_code = 'E'
AND fcr.actual_start_date > SYSDATE - :days_to_check
AND fcpt.user_concurrent_program_name like 'Refresh iSupport Materialized View'
--Query to find the Request set of a Concurrent Program
--input: Concurrent Program name
SELECT fcpt.user_concurrent_program_name PROGRAM
,frst.USER_REQUEST_SET_NAME REQUEST_SET
FROM fnd_request_sets_tl frst
,fnd_request_set_programs frsp
,fnd_concurrent_programs_tl fcpt
WHERE frst.request_set_id = frsp.request_set_id
AND fcpt.application_id = frsp.program_application_id
AND fcpt.concurrent_program_id = frsp.concurrent_program_id
AND fcpt.user_concurrent_program_name like '%'||:Program_Name||'%'
--Query to find the Concurrent Requests which are incompatible with Request
--input: Concurrent program name
SELECT fcpt.user_concurrent_program_name Input_Program,
(SELECT fcpt1.user_concurrent_program_name Incompatible_Programs
FROM fnd_concurrent_programs_tl fcpt1
WHERE fcpt1.concurrent_program_id in (fcps.to_run_concurrent_program_id)
AND rownum = 1) Incompatible_Programs
FROM fnd_concurrent_program_serial fcps
,fnd_concurrent_programs_tl fcpt
WHERE fcps.running_concurrent_program_id = fcpt.concurrent_program_id
AND fcpt.user_concurrent_program_name like '%'||:Program_Name||'%'
--Query to find if a concurrent request is parent or not
--input: Concurrent request ID
SELECT NVL(fcr.has_sub_request,'N') IS_PARENT
FROM fnd_concurrent_requests fcr
WHERE fcr.request_id = :Request_ID
--Query to find the user who submitted a request
--input: Concurrent Request ID
SELECT jrre.source_name user_name
,jrre.user_id user_id
FROM fnd_concurrent_requests fcr
,jtf_rs_resource_extns jrre
WHERE jrre.user_id = fcr.requested_by
AND fcr.request_id = :Request_ID
--- Query to get XML Publisher report details
select * from apps.XDO_LOBS where lob_Code like 'XXTTD%TOMO%';
-- Query to find Org Access for the responsibilities
SELECT oa.organization_code,oa.responsibility_name
FROM apps.org_access_v oa
WHERE 1 = 1
AND oa.organization_code =<Org Code>
---- Responsibility for an Org_id
SELECT fr.responsibility_id,
frt.responsibility_name,
fr.application_id
FROM fnd_responsibility fr,
fnd_responsibility_vl frt,
fnd_profile_option_values a,
fnd_profile_options b
WHERE (fr.end_date IS NULL OR fr.end_date > SYSDATE)
AND fr.responsibility_id = a.level_value
AND fr.responsibility_id = frt.responsibility_id
AND a.profile_option_id = b.profile_option_id
AND a.level_id = 10003
AND b.profile_option_name = 'ORG_ID'
AND a.profile_option_value = 1019 --- Org_id Value
AND frt.responsibility_name LIKE '%:Res_name%'
AND SYSDATE BETWEEN frt.start_date
AND NVL (frt.end_date, SYSDATE)
---Query to find Profile value at Responsibility Level
SELECT fpov.profile_option_value days,
fpov.level_value,
fr.responsibility_name
FROM apps.fnd_profile_options_tl fpot,
apps.fnd_profile_option_values fpov,
apps.fnd_profile_options fpo,
apps.fnd_responsibility_tl fr
WHERE 1 = 1
AND fpo.profile_option_id = fpov.profile_option_id
AND fpo.profile_option_name = fpot.profile_option_name
AND fr.responsibility_id = fpov.level_value
AND fr.responsibility_name like '%DBW%'
-- and oav.RESP_APPLICATION_ID=401
AND fpot.LANGUAGE = USERENV ('LANG')
AND fpot.user_profile_option_name =
(<Profile_Name>);
---- _DEPENDENCIES Components
SELECT FCP.USER_CONCURRENT_PROGRAM_NAME,
FE.EXECUTION_FILE_NAME,
concurrent_program_id
FROM DBA_DEPENDENCIES DEP,
apps.fnd_executables fe,
apps.fnd_concurrent_programs_vl fcp
WHERE REFERENCED_NAME = :PACKAGE_NAME
AND UPPER (execution_file_name) LIKE '%' || DEP.NAME || '%'
AND fe.execuTABLE_ID = FCP.EXECUTABLE_ID;
--- Query to find User responsibilities
SELECT fu.user_name,
frt.responsibility_name,
furg.start_date,
furg.end_date,
frt.responsibility_id
FROM fnd_user fu,
fnd_user_resp_groups_direct furg,
fnd_responsibility_vl frt
WHERE fu.user_id = furg.user_id
AND frt.responsibility_id = furg.responsibility_id
AND frt.application_id = furg.responsibility_application_id
AND NVL (furg.end_date, SYSDATE + 1) > SYSDATE
AND NVL (frt.end_date, SYSDATE + 1) > SYSDATE
AND fu.user_name = <user_name>;
-----------------
Query to find Unit Code based on Inventory Organization
SELECT erp_unit_code,
erp_unit_code_desc
FROM (SELECT DISTINCT gcc.segment1 erp_unit_code,
SUBSTR
(apps.gl_flexfields_pkg.get_description_sql
(gcc.chart_of_accounts_id,
1,
gcc.segment1
),
1,
40
) erp_unit_code_desc
FROM gl_code_combinations gcc
WHERE 1 = 1
AND EXISTS (
SELECT 1
FROM mtl_parameters mp
WHERE 1 = 1
AND mp.material_account =
gcc.code_combination_id))
ORDER BY erp_unit_code
-------------------
Query to get Operating Unit, Legal Entity & Ledger in R12
SELECT A.BUSINESS_GROUP_ID,
A.ORGANIZATION_ID OU_ID,
A.NAME OU_NAME,
A.SHORT_CODE OU_SHORT_CODE,
A.SET_OF_BOOKS_ID,
A.DEFAULT_LEGAL_CONTEXT_ID,
B.NAME LEGAL_ENTITY_NAME,
C.NAME LEDGER_NAME
FROM hr_operating_units A, xle_entity_profiles B, GL_LEDGERS C
WHERE A.DEFAULT_LEGAL_CONTEXT_ID = B.LEGAL_ENTITY_ID
AND A.SET_OF_BOOKS_ID = C.LEDGER_ID
ORDER BY B.NAME