AR_CUSTOPTED_VW

(SQL View)
Index Back

SELECT DISTINCT C.SETID , C.CUST_ID , X.EFFDT , X.EFF_STATUS , X.CR_ANALYST , CA.NAME1 , CA.PHONE , CA.EXT_EMAIL_ADDR , X.COLLECTOR , CL.NAME1 , CL.PHONE , CL.EXT_EMAIL_ADDR , TM.SUPPORT_TEAM_MBR , MP.NAME1 , MP.EXT_EMAIL_ADDR FROM PS_CUSTOMER C , PS_CUST_OPTION X , PS_CUST_TEAM CT , PS_TEAM_CODE_TBL TCT , PS_TEAM_MEMBERS TM , PS_MEMBER_PERSON MP , PS_CR_ANALYST_TBL CA , PS_COLLECTOR_TBL CL WHERE C.CUST_STATUS = 'A' AND C.BILL_TO_FLG = 'Y' AND C.CUST_LEVEL <> 'P' AND C.SETID = X.SETID AND C.CUST_ID = X.CUST_ID AND X.EFFDT = ( SELECT MAX(EFFDT) FROM PS_CUST_OPTION WHERE SETID = X.SETID AND CUST_ID = X.CUST_ID AND EFF_STATUS = 'A' AND EFFDT <= %CurrentDateIn) AND CT.SETID = C.SETID AND CT.CUST_ID = C.CUST_ID AND CT.DEFAULT_FLAG = 'Y' AND TCT.SETID = ( SELECT SETID FROM PS_SET_CNTRL_REC WHERE RECNAME = 'TEAM_CODE_TBL' AND SETCNTRLVALUE = CT.SETID) AND TCT.SUPPORT_TEAM_CD = CT.SUPPORT_TEAM_CD AND TCT.EFFDT = ( SELECT MAX(X2.EFFDT) FROM PS_TEAM_CODE_TBL X2 WHERE X2.SETID = TCT.SETID AND X2.SUPPORT_TEAM_CD = CT.SUPPORT_TEAM_CD AND X2.EFFDT <= %CurrentDateIn AND X2.EFF_STATUS = 'A') AND TM.SETID = TCT.SETID AND TM.SUPPORT_TEAM_CD = TCT.SUPPORT_TEAM_CD AND TM.EFFDT = TCT.EFFDT AND TM.PRIORITY = ( SELECT MIN(Y.PRIORITY) FROM PS_TEAM_MEMBERS Y , PS_MEMBER_PERSON MP , PS_MEMBER_TYPE_TBL MT WHERE Y.SETID = TM.SETID AND Y.SUPPORT_TEAM_CD = TM.SUPPORT_TEAM_CD AND Y.EFFDT = TM.EFFDT AND Y.PRIORITY > 0 AND MP.SETID = Y.SETID AND MP.SUPPORT_TEAM_MBR = Y.SUPPORT_TEAM_MBR AND MT.SETID = MP.SETID AND MT.TEAM_MEMBER_TYPE = MP.TEAM_MEMBER_TYPE AND MT.EFFDT = ( SELECT MAX(MT2.EFFDT) FROM PS_MEMBER_TYPE_TBL MT2 WHERE MT2.SETID = MT.SETID AND MT2.TEAM_MEMBER_TYPE = MT.TEAM_MEMBER_TYPE AND MT2.EFFDT <= %CurrentDateIn AND MT2.EFF_STATUS = 'A') AND MT.SALES_PERSON = 'Y' ) AND MP.SETID = TM.SETID AND MP.SUPPORT_TEAM_MBR = TM.SUPPORT_TEAM_MBR AND CA.SETID = X.SETID AND CA.CR_ANALYST = X.CR_ANALYST AND CA.EFF_STATUS = 'A' AND %EffdtCheck(CR_ANALYST_TBL CAX, CA, %CurrentDateIn) AND CL.SETID = X.SETID AND CL.COLLECTOR = X.COLLECTOR AND CL.EFF_STATUS = 'A' AND %EffdtCheck(COLLECTOR_TBL CLX, CL, %CurrentDateIn)

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 SETID Character(5) VARCHAR2(5) NOT NULL SetID
2 CUST_ID Character(15) VARCHAR2(15) NOT NULL Uniquely identifies an organizational entity that purchases goods or services from the enterprise. Represents the sold-to customer which is the customer organization that places orders. The CUST_ID may or may not be the same as the identifiers for the bill-to and ship-to locations.
3 EFFDT Date(10) DATE Effective Date

Default Value: %date

4 EFF_STATUS Character(1) VARCHAR2(1) NOT NULL Effective Status
A=Active
I=Inactive
5 CR_ANALYST Character(8) VARCHAR2(8) NOT NULL Specifies the personnel code for the person who works with a customer to establish credit limits and payment terms. This field is required for a bill-to customer.
6 NAME3 Character(40) VARCHAR2(40) NOT NULL Name 3
7 PHONE2 Character(24) VARCHAR2(24) NOT NULL Telephone
8 EXT_EMAIL_ADDR2 Character(70) VARCHAR2(70) NOT NULL Electronic Mail Address
9 COLLECTOR Character(8) VARCHAR2(8) NOT NULL Specifies the personnel code for the person who works with a customer to collect overdue payments.
10 NAME4 Character(40) VARCHAR2(40) NOT NULL NAME4
11 PHONE3 Character(24) VARCHAR2(24) NOT NULL Telephone
12 EXT_EMAIL_ADDR3 Character(70) VARCHAR2(70) NOT NULL Electronic Mail Address
13 SALES_PERSON Character(8) VARCHAR2(8) NOT NULL Specifies the personnel code for the person who works with a customer as a sales representative. This field is required for a customer that functions as a bill-to customer.
14 NAME2 Character(40) VARCHAR2(40) NOT NULL Name 2
15 EXT_EMAIL_ADDR Character(70) VARCHAR2(70) NOT NULL Electronic Mail Address