RSF_TR_MGR_VW

(SQL View)
Index Back

Territory Manager View

View of all active territories as manager. This is used as a dataset rule for searching for territories.

SELECT A.TREE_NAME , A.TERRITORY_ID , A.DESCR , A.SYNCID , C.PERSON_ID FROM PS_RSF_TR_SRCH A , PSTREENODE B , PS_RSF_TR_TEAM C WHERE A.TREE_NAME = B.TREE_NAME AND A.TERRITORY_ID = B.TREE_NODE AND B.TREE_NODE IN ( SELECT X.TREE_NODE FROM PSTREENODE X WHERE X.TREE_NODE_NUM >= ( SELECT MIN(N.TREE_NODE_NUM) FROM PSTREENODE N , PS_RSF_TR_TEAM T WHERE N.TREE_NAME = T.TREE_NAME AND N.TREE_NODE = T.TERRITORY_ID AND T.PERSON_ID = C.PERSON_ID AND T.TREE_NAME = B.TREE_NAME AND T.EFFDT = ( SELECT MAX(Y.EFFDT) FROM PS_RSF_TR_TEAM Y WHERE Y.TREE_NAME = T.TREE_NAME AND Y.TERRITORY_ID = T.TERRITORY_ID AND Y.EFFDT <= %CurrentDateIn)) AND X.TREE_NODE_NUM_END <= ( SELECT MAX(N.TREE_NODE_NUM_END) FROM PSTREENODE N , PS_RSF_TR_TEAM T WHERE N.TREE_NAME = T.TREE_NAME AND N.TREE_NODE = T.TERRITORY_ID AND T.PERSON_ID = C.PERSON_ID AND T.TREE_NAME = B.TREE_NAME AND T.EFFDT = ( SELECT MAX(Y.EFFDT) FROM PS_RSF_TR_TEAM Y WHERE Y.TREE_NAME = T.TREE_NAME AND Y.TERRITORY_ID = T.TERRITORY_ID AND Y.EFFDT <= %CurrentDateIn))) AND B.TREE_NAME = C.TREE_NAME AND C.EFFDT = ( SELECT MAX(Y.EFFDT) FROM PS_RSF_TR_TEAM Y WHERE Y.TREE_NAME = C.TREE_NAME AND Y.TERRITORY_ID = C.TERRITORY_ID AND Y.EFFDT <= %CurrentDateIn)

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 TREE_NAME Character(18) VARCHAR2(18) NOT NULL Tree Name

Prompt Table: RSF_TR_TREE_VW

2 TERRITORY_ID Character(20) VARCHAR2(20) NOT NULL Territory ID
3 DESCR Character(30) VARCHAR2(30) NOT NULL Description
4 SYNCID Number(10,0) DECIMAL(10) NOT NULL The Synchronization ID field stores a value generated by the sync processor. The value is used to identify the type of object that the sync processor is about to handle.
5 PERSON_ID_MANAGER Character(15) VARCHAR2(15) NOT NULL Contact Identifier for Treasury Contacts