SELECT %Substring(RF1.ATTRIBUTE_VALUE,1,11) , O.INST_PROD_ID , O.SYNCID FROM PS_RC_CASE O , PS_BO_NAME E , PS_BO_ROLE_TYPE G , PS_RF_ATTR_INSP RF1 , PS_RF_INST_PROD RF3 , PS_RBT_ACCOUNT RBT WHERE O.BO_ID_CUST = E.BO_ID AND E.PRIMARY_IND = 'Y' AND O.ROLE_TYPE_ID_CUST = G.ROLE_TYPE_ID AND O.BO_ID_CUST = RBT.RBTCUST_BO_ID AND RBT.RBTACCTID = RF3.RBTACCTID AND (RF3.SETID IN ( SELECT E.SETID FROM PS_SET_CNTRL_REC E WHERE E.SETCNTRLVALUE = O.BUSINESS_UNIT AND E.RECNAME = 'RF_INST_PROD') AND RF3.INST_PROD_ID = O.INST_PROD_ID) AND (RF3.SETID = RF1.SETID AND RF3.INST_PROD_ID = RF1.INST_PROD_ID) AND RF1.ATTRIBUTE_ID IN ( SELECT ATTRIBUTE_ID FROM PS_RB_ATTRIBUTE WHERE ATTRIBUTE_ID = 'PS_PHONE_NUM' AND ATTR_STATUS = 'ACTV')
|