SELECT A.SCE_ID ,C.PROCESS_STEP AS RTBL_ELEMENT ,C.VERSION_NUM ,'' ,B.SETID FROM %Table(RTBL_SCENARIO) A , %Table(RTBL_ELEMENT) B , %Table(ALLOC_GRSTP_TBL) C WHERE A.SCE_ID=B.SCE_ID AND B.RTBL_ELEMENT=C.PROCESS_GROUP AND B.VERSION_NUM=C.VERSION_GRP AND A.STATUS_SCENARIO NOT IN ('RP','RA','RD','RC','RY') UNION SELECT A.SCE_ID ,B.RTBL_ELEMENT ,B.VERSION_NUM ,'' ,B.SETID FROM %Table(RTBL_SCENARIO) A , %Table(RTBL_DEPLOY_HIS) B WHERE A.SCE_ID=B.SCE_ID AND A.STATUS_SCENARIO IN ('RP','RA','RD','RC','RY')
|