SELECT
papf.employee_number,
papf.full_name,
papf1.full_name,
ppt.user_person_type,
fcl.meaning
FROM
per_all_people_f papf,
per_contact_relationships pcr,
per_all_people_f papf1,
fnd_common_lookups fcl,
per_person_type_usages_f ppu,
per_person_types ppt
WHERE
papf.business_group_id = P_BUSINESS_GROUP_ID
AND papf.current_employee_flag = 'Y'
AND TRUNC(SYSDATE) BETWEEN papf.effective_start_date AND papf.effective_end_date
AND pcr.person_id = papf.person_id
AND TRUNC(SYSDATE) BETWEEN papf1.effective_start_date AND papf1.effective_end_date
AND papf1.person_id = pcr.contact_person_id
AND UPPER(fcl.lookup_type) = UPPER('CONTACT')
AND fcl.lookup_code = pcr.contact_type
AND papf1.person_id = ppu.person_id
AND ppu.person_type_id = ppt.person_type_id
AND TRUNC(SYSDATE) BETWEEN ppu.effective_start_date AND ppu.effective_end_date;
papf.employee_number,
papf.full_name,
papf1.full_name,
ppt.user_person_type,
fcl.meaning
FROM
per_all_people_f papf,
per_contact_relationships pcr,
per_all_people_f papf1,
fnd_common_lookups fcl,
per_person_type_usages_f ppu,
per_person_types ppt
WHERE
papf.business_group_id = P_BUSINESS_GROUP_ID
AND papf.current_employee_flag = 'Y'
AND TRUNC(SYSDATE) BETWEEN papf.effective_start_date AND papf.effective_end_date
AND pcr.person_id = papf.person_id
AND TRUNC(SYSDATE) BETWEEN papf1.effective_start_date AND papf1.effective_end_date
AND papf1.person_id = pcr.contact_person_id
AND UPPER(fcl.lookup_type) = UPPER('CONTACT')
AND fcl.lookup_code = pcr.contact_type
AND papf1.person_id = ppu.person_id
AND ppu.person_type_id = ppt.person_type_id
AND TRUNC(SYSDATE) BETWEEN ppu.effective_start_date AND ppu.effective_end_date;
No comments:
Post a Comment