SELECT A.SETID , A.CNTRCT_ID , A.CAT_LINE_NBR , E.LANGUAGE_CD , E.DESCR60 FROM PS_CNTRCT_CATEGORY A , PS_CNTRCT_HDR H , PS_ITM_CAT_TBL C , PS_INSTALLATION_PO D , PS_ITM_CAT_TBL_LNG E WHERE H.VERSION_STATUS = 'C' AND A.SETID = H.SETID AND A.CNTRCT_ID = H.CNTRCT_ID AND A.VERSION_NBR = H.VERSION_NBR AND A.LINE_STATUS NOT IN ('C','I') AND A.CATEGORY_SETID = C.SETID AND A.CATEGORY_ID = C.CATEGORY_ID AND C.CATEGORY_TYPE = D.CATEGORY_TYPE AND %EffdtCheck(ITM_CAT_TBL E, C, H.CNTRCT_BEGIN_DT) AND C.SETID = E.SETID AND C.CATEGORY_TYPE = E.CATEGORY_TYPE AND C.CATEGORY_CD = E.CATEGORY_CD AND C.CATEGORY_ID = E.CATEGORY_ID AND C.EFFDT = E.EFFDT AND C.EFF_STATUS = 'A' AND EXISTS ( SELECT 'x' FROM PS_CS_CNT_AG B WHERE A.SETID = B.SETID AND A.CNTRCT_ID=B.CNTRCT_ID AND A.CAT_LINE_NBR=B.CAT_LINE_NBR AND B.CNTRCT_LINE_NBR = 0 AND A.VERSION_NBR=B.VERSION_NBR)
|