Employee Contact Information in Oracle HRMS
Query:
SELECT
PAPF.EMPLOYEE_NUMBER
,PAPF.FULL_NAME
,PCR.DATE_START CONTACT_START_DATE
,PPF.TITLE CONTACTS_TITLE
,PPF.FIRST_NAME||PPF.MIDDLE_NAMES FIRST_AND_MIDDLE_NAME
,PPF.LAST_NAME
,PPF.PRE_NAME_ADJUNCT PREFIX
,PPF.SUFFIX
,PPF.MIDDLE_NAMES MIDDLE
,NVL ( hr_person_type_usage_info.get_user_person_type (FS.effective_date,
PAPF.person_id),
hr_person_type_usage_info.get_user_person_type (
PAPF.effective_start_date,
PAPF.person_id)) CONTACT
,PPF.SEX GENDER
,PPF.NATIONAL_IDENTIFIER NATIONAL_IDENTITY_NO
,PPF.DATE_OF_BIRTH
,PCR.CONTACT_TYPE
,PCR.DATE_START RELATIONSHIP_START_DATE
,PCR.DATE_END RELATIONSHIP_END_DATE
,BEN1.NAME RELATIONSHIP_START_REASON
,BEN2.NAME RELATIONSHIP_END_REASON
,PCR.PRIMARY_CONTACT_FLAG PRIMARY_CONTACT
,PCR.THIRD_PARTY_PAY_FLAG PAYMENT_RECIPTS
,PCR.RLTD_PER_RSDS_W_DSGNTR_FLAG SHARED_RESIDENCE
,PCR.PERSONAL_FLAG PERSONAL_RELATIONSHIP
,PCR.BENEFICIARY_FLAG BENEFICIARY
,PCR.DEPENDENT_FLAG DEPENDENT
,DECODE(PP.PHONE_TYPE,'M','Mobile',PP.PHONE_TYPE)PHONE_TYPE
,PP.PHONE_NUMBER
,PP.DATE_FROM START_DATE_OF_PHONE_NO
,PP.DATE_TO END_DATE_OF_PHONE_NO
,AD.STYLE
,AD.ADDRESS_LINE1
,AD.ADDRESS_LINE2
,AD.ADDRESS_LINE3
,AD.TOWN_OR_CITY
,AD.REGION_1 DISTRICT
,AD.REGION_2 POLICE_STATION
,AD.REGION_3 CITY
,AD.COUNTRY
,AD.POSTAL_CODE POSTAL_CODE
,HL.MEANING ADDRESS_TYPE
,AD.DATE_FROM START_DATE_OF_ADDRESS
,AD.DATE_TO ADDRESS_DATE_TO
,AD.PRIMARY_FLAG
FROM PER_ALL_PEOPLE_F PAPF
,PER_CONTACT_RELATIONSHIPS PCR
,PER_PEOPLE_F PPF
,PER_ADDRESSES AD
,PER_PHONES PP
,HR_LOOKUPS HL
,BEN_LER_F_VL BEN1
,BEN_LER_F_VL BEN2
,FND_SESSIONS FS
WHERE 1=1
AND PAPF.PERSON_ID = PCR.PERSON_ID
AND PCR.CONTACT_PERSON_ID = PPF.PERSON_ID
AND PPF.PERSON_ID = AD.PERSON_ID(+)
AND PPF.PERSON_ID = PP.PARENT_ID(+)
AND HL.LOOKUP_TYPE(+) = ' ADDRESS_TYPE'
AND AD.ADDRESS_TYPE = HL.LOOKUP_CODE(+)
AND PCR.START_LIFE_REASON_ID = BEN1.LER_ID(+)
AND PCR.END_LIFE_REASON_ID = BEN2.LER_ID(+)
AND FS.SESSION_ID = 239330399
--AND PAPF.EMPLOYEE_NUMBER = 7120--1235--7120--1235--3098
AND SYSDATE BETWEEN PAPF.EFFECTIVE_START_DATE AND PAPF.EFFECTIVE_END_DATE
AND SYSDATE BETWEEN PPF.EFFECTIVE_START_DATE AND PPF.EFFECTIVE_END_DATE
ORDER BY papf.EMPLOYEE_NUMBER
No comments:
Thank you for your comment...!