SELECT DISTINCT asu.segment1 vendor_number,
asu.vendor_name,
asu.start_date_active vendor_start_date_active,
asu.end_date_active vendor_end_date_active,
assa.vendor_site_code,
assa.inactive_date vendor_site_inactive_date,
hou.name Operating_Unit_Name,
assa.address_line1,
assa.city,
assa.state,
assa.zip,
hpc.party_name Contact_Name,
hpr.primary_phone_country_code Contact_phone_country_code,
hpr.primary_phone_area_code Contact_phone_area,
hpr.primary_phone_number Contact_phone_number,
hpr.email_address Contact_email_address,
hpcp.status contact_status
FROM ap_suppliers asu,
ap_supplier_sites_all assa,
hz_relationships hr,
ap_supplier_contacts asco,
hz_org_contacts hoc,
hz_parties hpc,
hz_parties hpr,
hz_contact_points hpcp,
hr_operating_units hou
WHERE 1 = 1
AND asu.vendor_id = assa.vendor_id
AND assa.org_id = hou.organization_id
AND assa.party_site_id = asco.org_party_site_id(+)
AND asco.relationship_id = hoc.party_relationship_id(+)
AND hoc.party_relationship_id = hr.relationship_id(+)
AND asu.party_id = hr.subject_id(+)
AND hr.relationship_code(+) = 'CONTACT'
AND hr.object_table_name(+) = 'HZ_PARTIES'
AND hr.object_id = hpc.party_id(+)
AND hr.party_id = hpr.party_id(+)
AND hpr.party_type(+) = 'PARTY_RELATIONSHIP'
AND hpr.party_id = hpcp.owner_table_id(+)
AND hpcp.owner_table_name(+) = 'HZ_PARTIES'
ORDER BY asu.segment1
asu.vendor_name,
asu.start_date_active vendor_start_date_active,
asu.end_date_active vendor_end_date_active,
assa.vendor_site_code,
assa.inactive_date vendor_site_inactive_date,
hou.name Operating_Unit_Name,
assa.address_line1,
assa.city,
assa.state,
assa.zip,
hpc.party_name Contact_Name,
hpr.primary_phone_country_code Contact_phone_country_code,
hpr.primary_phone_area_code Contact_phone_area,
hpr.primary_phone_number Contact_phone_number,
hpr.email_address Contact_email_address,
hpcp.status contact_status
FROM ap_suppliers asu,
ap_supplier_sites_all assa,
hz_relationships hr,
ap_supplier_contacts asco,
hz_org_contacts hoc,
hz_parties hpc,
hz_parties hpr,
hz_contact_points hpcp,
hr_operating_units hou
WHERE 1 = 1
AND asu.vendor_id = assa.vendor_id
AND assa.org_id = hou.organization_id
AND assa.party_site_id = asco.org_party_site_id(+)
AND asco.relationship_id = hoc.party_relationship_id(+)
AND hoc.party_relationship_id = hr.relationship_id(+)
AND asu.party_id = hr.subject_id(+)
AND hr.relationship_code(+) = 'CONTACT'
AND hr.object_table_name(+) = 'HZ_PARTIES'
AND hr.object_id = hpc.party_id(+)
AND hr.party_id = hpr.party_id(+)
AND hpr.party_type(+) = 'PARTY_RELATIONSHIP'
AND hpr.party_id = hpcp.owner_table_id(+)
AND hpcp.owner_table_name(+) = 'HZ_PARTIES'
ORDER BY asu.segment1
No comments:
Post a Comment