SELECT DISTINCT A.BO_ID ,G.LANGUAGE_CD ,B.RA_WAVE_NAME ,C.RA_OFFER_NAME ,F.XLATSHORTNAME ,G.DESCR FROM PS_RA_LIST_REC A , PS_RA_CMPGN_WAVE B , PS_RA_OFFER C , PSXLATITEMLANG F , PS_RA_OFFPRDPRC_L G , PS_RA_UD_CHNL_TYPE H WHERE A.RA_LIST_ID = B.RA_LIST_ID AND A.SETID = ( SELECT SETID FROM PS_SET_CNTRL_REC WHERE SETCNTRLVALUE = B.BUSINESS_UNIT AND RECNAME = 'RA_LIST_REC') AND A.DELETED_FLG = 'N' AND C.SETID = ( SELECT SETID FROM PS_SET_CNTRL_REC WHERE SETCNTRLVALUE = B.BUSINESS_UNIT AND RECNAME = 'RA_OFFER') AND B.RA_OFFER_ID = C.RA_OFFER_ID AND B.RA_SCRIPT_ID_INBN <> 0 AND B.RA_ACTIVITY_CD = H.RA_ACTIVITY_CD AND B.RA_CHANNEL_TYPE = H.RA_CHANNEL_TYPE AND H.SETID = ( SELECT SETID FROM PS_SET_CNTRL_REC WHERE SETCNTRLVALUE = B.BUSINESS_UNIT AND RECNAME = 'RA_UD_CHNL_TYPE') AND H.RA_CHNL_EXECUTION= '030' AND F.FIELDNAME = 'RA_PRIORITY' AND F.FIELDVALUE = B.RA_PRIORITY AND F.EFFDT = ( SELECT MAX(E.EFFDT) FROM PSXLATITEM E WHERE E.FIELDNAME = F.FIELDNAME AND E.FIELDVALUE = F.FIELDVALUE AND E.EFFDT <= %CurrentDateIn AND E.EFF_STATUS = 'A') AND G.SETID = C.SETID AND G.RA_OFFER_ID = C.RA_OFFER_ID AND G.PRICE_SET_ID = C.PRICE_SET_ID
|