GPHK_EESP_PP_VW(SQL View) |
Index Back |
---|---|
Retrieve Spouse Passport DtlThe CITIZEN_PSSPRT table contains passport details of both employees and their dependants. We need this to retrieve the correct details for the spouse. |
SELECT A.EMPLID , A.PASSPORT_NBR , A.COUNTRY_PASSPORT FROM PS_CITIZEN_PSSPRT A , PS_DEP_BEN B , PS_DEP_BEN_EFF C WHERE A.EMPLID = B.EMPLID AND A.EMPLID = C.EMPLID AND B.EMPLID = C.EMPLID AND A.DEPENDENT_ID = B.DEPENDENT_BENEF AND A.DEPENDENT_ID = C.DEPENDENT_BENEF AND B.DEPENDENT_BENEF = C.DEPENDENT_BENEF AND C.RELATIONSHIP = 'SP' AND C.EFFDT = ( SELECT MAX(C1.EFFDT) FROM PS_DEP_BEN_EFF C1 WHERE C1.EMPLID = C.EMPLID AND C1.DEPENDENT_BENEF = C.DEPENDENT_BENEF) |
# | PeopleSoft Field Name | PeopleSoft Field Type | Database Column Type | Description |
---|---|---|---|---|
1 | EMPLID | Character(11) | VARCHAR2(11) NOT NULL | Employee ID |
2 | PASSPORT_NBR | Character(15) | VARCHAR2(15) NOT NULL | Passport Number |
3 | COUNTRY_PASSPORT | Character(3) | VARCHAR2(3) NOT NULL | Country Issuing Passport |