SELECT A.FIELDNAME , C.LANGUAGE_CD , C.LONGNAME FROM PS_PV_WSRULE_SETUP A , PSPTSF_SD_ATTR B , PSDBFLDLABLLANG C , PSDBFLDLABL D WHERE B.PTSF_SBO_NAME IN ('EP_PV_MASTERITEMVENDOR_SD','EP_PV_MASTERITEM_SD') AND B.PTSF_SRCATTR_NAME=A.FIELDNAME AND A.FIELDNAME=C.FIELDNAME AND C.FIELDNAME=D.FIELDNAME AND C.LABEL_ID=D.LABEL_ID AND D.DEFAULT_LABEL=1 AND EXISTS( SELECT 'X' FROM PS_PV_WS_FIELDS_VW F WHERE F.FIELDNAME=A.FIELDNAME) UNION SELECT A.FIELDNAME , C.LANGUAGE_CD , C.LONGNAME FROM PS_PV_WSRULE_SETUP A , PSPTSF_SD_ATTR B , PSDBFLDLABLLANG C WHERE B.PTSF_SBO_NAME IN ('EP_PV_MASTERITEMVENDOR_SD','EP_PV_MASTERITEM_SD') AND B.PTSF_SRCATTR_NAME<>A.FIELDNAME AND A.FIELDNAME= %Substring(B.PTSF_SRCATTR_NAME,1,LENGTH(A.FIELDNAME)) AND A.FIELDNAME=C.FIELDNAME AND C.LABEL_ID= %Substring(B.PTSF_SRCATTR_NAME,LENGTH(A.FIELDNAME)+2 ,LENGTH(B.PTSF_SRCATTR_NAME)) AND EXISTS( SELECT 'X' FROM PS_PV_WS_FIELDS_VW F WHERE F.FIELDNAME=A.FIELDNAME)
|