SELECT A.BUSINESS_UNIT , A.COMMON_ID , C.LANGUAGE_CD , F.DESCR , C.DESCR FROM PS_ITEM_LINE_SF A , PS_ITEM_SF B , PS_ITEM_TYPE_LNG C , PS_BUS_UNIT_TBL_SF D , PS_EXT_ORG_TBL F WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT AND A.COMMON_ID = B.COMMON_ID AND A.SA_ID_TYPE = B.SA_ID_TYPE AND A.ITEM_NBR = B.ITEM_NBR AND B.SA_ID_TYPE = 'O' AND A.BUSINESS_UNIT = D.BUSINESS_UNIT AND B.ITEM_TYPE = C.ITEM_TYPE AND C.EFFDT = ( SELECT MAX(E.EFFDT) FROM PS_ITEM_TYPE_TBL E WHERE C.SETID = E.SETID AND C.ITEM_TYPE = E.ITEM_TYPE AND E.EFFDT <= %CurrentDateIn) AND C.SETID = ( SELECT SETID FROM PS_SET_CNTRL_REC E WHERE E.SETCNTRLVALUE = D.INSTITUTION AND E.RECNAME = 'ITEM_TYPE_TBL') AND A.COMMON_ID = F.EXT_ORG_ID AND F.EFFDT = ( SELECT MAX(G.EFFDT) FROM PS_EXT_ORG_TBL G WHERE G.EXT_ORG_ID = F.EXT_ORG_ID AND G.EFFDT <= %CurrentDateIn)
|