Query to fetch employee details and national identifiers details


Query to fetch employee details and national identifiers details


select papf.person_number,
       papf.person_id,
       papf.start_date,
       ppnf.full_name                employee_full_name,
       pni.national_identifier_number,
       per_extract_utility.get_decoded_lookup('PER_NATIONAL_IDENTIFIER_TYPE',
       pni.national_identifier_type) national_identifier_type,
       pni.place_of_issue,
       pni.expiration_date,
       pni.issue_date
from   per_all_people_f papf,
       per_national_identifiers pni,
       per_person_names_f ppnf
where  1 = 1
       and trunc(sysdate) between papf.effective_start_date and
                                  papf.effective_end_date
       and papf.person_id = ppnf.person_id
       and trunc(sysdate) between ppnf.effective_start_date and
                                  ppnf.effective_end_date
       and ppnf.name_type = 'GLOBAL'
       and papf.person_id = pni.person_id
--and papf.person_number = :p_person_number -- parameter

No comments:

Post a Comment