Friday 27 November 2015

Query to Finds the Request Set Details

SELECT FRSS.DISPLAY_SEQUENCE SEQ            ,FRS.USER_REQUEST_SET_NAME
            ,FCP.USER_CONCURRENT_PROGRAM_NAME
            ,FE.EXECUTABLE_NAME
            ,FE.EXECUTION_FILE_NAME
            ,FLV.MEANING FILE_TYPE
            ,FAT.APPLICATION_NAME
FROM FND_REQUEST_SETS_VL FRS
         ,FND_REQ_SET_STAGES_FORM_V FRSS
         ,FND_REQUEST_SET_PROGRAMS RSP
         ,FND_CONCURRENT_PROGRAMS_VL FCP
         ,FND_EXECUTABLES FE
         ,FND_LOOKUP_VALUES FLV
         ,FND_APPLICATION_TL FAT
WHERE 1=1
     AND FRS.APPLICATION_ID = FRSS.SET_APPLICATION_ID
     AND FRS.REQUEST_SET_ID = FRSS.REQUEST_SET_ID
     AND FE.APPLICATION_ID =FAT.APPLICATION_ID
     AND FRSS.SET_APPLICATION_ID = RSP.SET_APPLICATION_ID
     AND FRSS.REQUEST_SET_ID = RSP.REQUEST_SET_ID
     AND FRSS.REQUEST_SET_STAGE_ID = RSP.REQUEST_SET_STAGE_ID
     AND RSP.PROGRAM_APPLICATION_ID = FCP.APPLICATION_ID
     AND RSP.CONCURRENT_PROGRAM_ID = FCP.CONCURRENT_PROGRAM_ID
     AND FCP.EXECUTABLE_ID = FE.EXECUTABLE_ID
     AND FCP.EXECUTABLE_APPLICATION_ID = FE.APPLICATION_ID
     AND FLV.LOOKUP_TYPE = 'CP_EXECUTION_METHOD_CODE'
     AND FLV.LOOKUP_CODE = FE.EXECUTION_METHOD_CODE
     AND FLV.LANGUAGE='US'
     AND FAT.LANGUAGE='US'
     AND FRS.END_DATE_ACTIVE IS NULL
     AND (RS.USER_REQUEST_SET_NAME = :P_REQUEST_SET_NAME OR :P_REQUEST_SET_NAME IS NULL)
ORDER BY 1