PeopleSoft通过status汇总进程运行情况

时间:2022-07-24 16:53:04

下面SQL可以按照run_status汇总进程的运行状态

SELECT RQST.RUNSTATUS,
RQST.PRCSTYPE,
(SELECT XLAT.XLATLONGNAME
FROM PSXLATITEM XLAT
WHERE XLAT.EFFDT =
(SELECT MAX(XLAT_ED.EFFDT)
FROM PSXLATITEM XLAT_ED
WHERE XLAT_ED.FIELDNAME = XLAT.FIELDNAME
AND XLAT_ED.FIELDVALUE = XLAT.FIELDVALUE)
AND XLAT.FIELDNAME = 'RUNSTATUS'
AND XLAT.FIELDVALUE = RQST.RUNSTATUS) AS RUNSTATUS_XLAT,
COUNT(RQST.PRCSINSTANCE) AS TOTAL_PROCESSES,
MIN(RUNDTTM) AS FIRST_OCCURRED,
MAX(RUNDTTM) AS LAST_OCCURRED
FROM PSPRCSRQST RQST
GROUP BY RQST.RUNSTATUS, RQST.PRCSTYPE
ORDER BY RUNSTATUS_XLAT, RQST.PRCSTYPE

示例运行结果如下:

PeopleSoft通过status汇总进程运行情况