SELECT S.EVENT_TYPE , S.SERVICE_GROUP_ID , S.USERID , S.USER_ORDER_TYPE , ' ' AS DIFFVALUE FROM PS_FO_SVC_EVNT_TBL S UNION SELECT DISTINCT SUB.EVENT_TYPE , P.SERVICE_GROUP_ID , P.USERID , P.USER_ORDER_TYPE , P.FO_EVNT_PRCS FROM PS_FO_SVC_PRCS_TBL P , PS_FO_EVENTS_PROC SUB , PS_SET_CNTRL_REC R WHERE P.FO_EVNT_PRCS = SUB.FO_EVNT_PRCS AND SUB.SETID = R.SETCNTRLVALUE AND R.RECNAME='FO_EVENTS_PROC' AND SUB.EFF_STATUS = 'A' AND SUB.EFFDT <= %CurrentDateIn UNION SELECT CAT.EVENT_TYPE , C.SERVICE_GROUP_ID , C.USERID , C.USER_ORDER_TYPE , C.EVENT_CATEGORY FROM PS_FO_SVC_CAT_TBL C , PS_FO_EVENTS_SETUP CAT WHERE C.EVENT_CATEGORY = CAT.EVENT_CATEGORY AND CAT.EVENT = 'TMP' AND CAT.FO_EVNT_PROC <> 'Y' UNION SELECT SUB.EVENT_TYPE , C.SERVICE_GROUP_ID , C.USERID , C.USER_ORDER_TYPE , C.EVENT_CATEGORY FROM PS_FO_SVC_CAT_TBL C , PS_FO_EVENTS_SETUP CAT , PS_FO_EVENTS_PROC SUB WHERE C.EVENT_CATEGORY = CAT.EVENT_CATEGORY AND CAT.EVENT_TYPE = SUB.FO_EVNT_PRCS AND CAT.EVENT = 'TMP' AND CAT.FO_EVNT_PROC = 'Y'
|