---Oracle R12 Supplier extraction Query
SELECT ap.segment1 vendor_code,
ap.vendor_name Suppliers_Name,
aps.vendor_site_code Supplier_Site_Code,
ap.VENDOR_TYPE_LOOKUP_CODE Type_Code,
aps.address_line1,
aps.address_line2,
aps.address_line3,
aps.city,
aps.state,
aps.zip,
aps.Country,
apc.AREA_CODE,
apc.PHONE,
apc.FAX_AREA_CODE,
apc.FAX,
apc.EMAIL_ADDRESS,
ap.PAYMENT_CURRENCY_CODE CURRENCY_CODE,
(Select Name from hr_operating_units where organization_id=aps.ORG_ID) OU_NAME,
aps.vat_registration_num,
ap.offset_tax_flag offset_tax_flag_header,
aps.auto_tax_calc_flag,
aps.offset_tax_flag offset_tax_flag_line,
aps.attribute2 free_field
FROM ap_suppliers ap,
ap_supplier_sites_all aps,
ap_supplier_contacts apc
WHERE ap.vendor_id = aps.vendor_id
AND apc.VENDOR_CONTACT_ID(+) = ap.VENDOR_ID
AND ap.VENDOR_TYPE_LOOKUP_CODE <> 'EMPLOYEE'
AND aps.vendor_site_code NOT IN 'OFFICE'
AND ap.enabled_flag ='Y'
ORDER BY ap.vendor_name,ap.segment1
ap.vendor_name Suppliers_Name,
aps.vendor_site_code Supplier_Site_Code,
ap.VENDOR_TYPE_LOOKUP_CODE Type_Code,
aps.address_line1,
aps.address_line2,
aps.address_line3,
aps.city,
aps.state,
aps.zip,
aps.Country,
apc.AREA_CODE,
apc.PHONE,
apc.FAX_AREA_CODE,
apc.FAX,
apc.EMAIL_ADDRESS,
ap.PAYMENT_CURRENCY_CODE CURRENCY_CODE,
(Select Name from hr_operating_units where organization_id=aps.ORG_ID) OU_NAME,
aps.vat_registration_num,
ap.offset_tax_flag offset_tax_flag_header,
aps.auto_tax_calc_flag,
aps.offset_tax_flag offset_tax_flag_line,
aps.attribute2 free_field
FROM ap_suppliers ap,
ap_supplier_sites_all aps,
ap_supplier_contacts apc
WHERE ap.vendor_id = aps.vendor_id
AND apc.VENDOR_CONTACT_ID(+) = ap.VENDOR_ID
AND ap.VENDOR_TYPE_LOOKUP_CODE <> 'EMPLOYEE'
AND aps.vendor_site_code NOT IN 'OFFICE'
AND ap.enabled_flag ='Y'
ORDER BY ap.vendor_name,ap.segment1