In this session, we are going to see how to fetch Oracle Cloud Supplier data using SQL.
SQL Text:
select sup.vendor_name Supplier_Name ,sup.segment1 Supplier_Number ,sup_addr.party_site_name Address_Name ,sup_addr.address1 Address_Line_1 ,sup_addr.city City ,sup_addr.state State ,sup_addr.postal_code Postal_Code ,case when (sup_addr.phone_country_code is not null and sup_addr.phone_area_code is not null and sup_addr.phone_number is not null) then '+' || sup_addr.phone_country_code || ' (' || sup_addr.phone_area_code || ') ' || substr(sup_addr.phone_number,1,3) || '-' || substr(sup_addr.phone_number,4,4) else '' end Phone ,case when (sup_addr.address_purpose_ordering = 'Y' and sup_addr.address_purpose_remit_to = 'Y' and sup_addr.address_purpose_rfq_or_bidding = 'Y') then 'Ordering; Remit to; RFQ or Bidding' when (sup_addr.address_purpose_ordering = 'Y' and sup_addr.address_purpose_remit_to = 'Y' and sup_addr.address_purpose_rfq_or_bidding = 'N') then 'Ordering; Remit to' when (sup_addr.address_purpose_ordering = 'Y' and sup_addr.address_purpose_remit_to = 'N' and sup_addr.address_purpose_rfq_or_bidding = 'Y') then 'Ordering; RFQ or Bidding' when (sup_addr.address_purpose_ordering = 'N' and sup_addr.address_purpose_remit_to = 'Y' and sup_addr.address_purpose_rfq_or_bidding = 'Y') then 'Remit to; RFQ or Bidding' when (sup_addr.address_purpose_ordering = 'Y' and sup_addr.address_purpose_remit_to = 'N' and sup_addr.address_purpose_rfq_or_bidding = 'N') then 'Ordering' when (sup_addr.address_purpose_ordering = 'N' and sup_addr.address_purpose_remit_to = 'Y' and sup_addr.address_purpose_rfq_or_bidding = 'N') then 'Remit to' when (sup_addr.address_purpose_ordering = 'N' and sup_addr.address_purpose_remit_to = 'N' and sup_addr.address_purpose_rfq_or_bidding = 'Y') then 'RFQ or Bidding' else '' end Address_Purpose ,case when sup_site.inactive_date is null then 'Active' else 'Inactive' end Status ,sup_site.vendor_site_code Site ,(select bu_name from fun_bu_usages_v where 1 = 1 and module_key = 'PROCUREMENT_BF' and business_unit_id = sup_site.prc_bu_id) Procurement_BU ,case when (sup_site.pay_site_flag = 'Y' and sup_site.purchasing_site_flag = 'Y' and sup_site.primary_pay_site_flag = 'Y') then 'Purchasing; Pay; Primary Pay' when (sup_site.pay_site_flag = 'Y' and sup_site.primary_pay_site_flag = 'Y') then 'Pay; Primary Pay' when (sup_site.pay_site_flag = 'Y' and sup_site.purchasing_site_flag = 'Y') then 'Purchasing; Pay' when (sup_site.purchasing_site_flag = 'Y' and sup_site.primary_pay_site_flag = 'Y') then 'Purchasing; Primary Pay' when (sup_site.purchasing_site_flag = 'Y') then 'Purchasing' when (sup_site.pay_site_flag = 'Y') then 'Pay' when (sup_site.primary_pay_site_flag = 'Y') then 'Primary Pay' when (sup_site.rfq_only_site_flag = 'Y') then 'Sourcing Only' else '' end Site_Purpose from poz_suppliers_v sup ,poz_supplier_address_v sup_addr ,poz_supplier_sites_v sup_site where 1 = 1 and sup_site.vendor_id = sup.vendor_id and sup_addr.vendor_id = sup_site.vendor_id and sup_addr.party_site_id = sup_site.party_site_id order by sup.vendor_name
SQL Text:
select sup.vendor_name Supplier_Name ,sup.segment1 Supplier_Number ,sup_addr.party_site_name Address_Name ,sup_addr.address1 Address_Line_1 ,sup_addr.city City ,sup_addr.state State ,sup_addr.postal_code Postal_Code ,case when (sup_addr.phone_country_code is not null and sup_addr.phone_area_code is not null and sup_addr.phone_number is not null) then '+' || sup_addr.phone_country_code || ' (' || sup_addr.phone_area_code || ') ' || substr(sup_addr.phone_number,1,3) || '-' || substr(sup_addr.phone_number,4,4) else '' end Phone ,case when (sup_addr.address_purpose_ordering = 'Y' and sup_addr.address_purpose_remit_to = 'Y' and sup_addr.address_purpose_rfq_or_bidding = 'Y') then 'Ordering; Remit to; RFQ or Bidding' when (sup_addr.address_purpose_ordering = 'Y' and sup_addr.address_purpose_remit_to = 'Y' and sup_addr.address_purpose_rfq_or_bidding = 'N') then 'Ordering; Remit to' when (sup_addr.address_purpose_ordering = 'Y' and sup_addr.address_purpose_remit_to = 'N' and sup_addr.address_purpose_rfq_or_bidding = 'Y') then 'Ordering; RFQ or Bidding' when (sup_addr.address_purpose_ordering = 'N' and sup_addr.address_purpose_remit_to = 'Y' and sup_addr.address_purpose_rfq_or_bidding = 'Y') then 'Remit to; RFQ or Bidding' when (sup_addr.address_purpose_ordering = 'Y' and sup_addr.address_purpose_remit_to = 'N' and sup_addr.address_purpose_rfq_or_bidding = 'N') then 'Ordering' when (sup_addr.address_purpose_ordering = 'N' and sup_addr.address_purpose_remit_to = 'Y' and sup_addr.address_purpose_rfq_or_bidding = 'N') then 'Remit to' when (sup_addr.address_purpose_ordering = 'N' and sup_addr.address_purpose_remit_to = 'N' and sup_addr.address_purpose_rfq_or_bidding = 'Y') then 'RFQ or Bidding' else '' end Address_Purpose ,case when sup_site.inactive_date is null then 'Active' else 'Inactive' end Status ,sup_site.vendor_site_code Site ,(select bu_name from fun_bu_usages_v where 1 = 1 and module_key = 'PROCUREMENT_BF' and business_unit_id = sup_site.prc_bu_id) Procurement_BU ,case when (sup_site.pay_site_flag = 'Y' and sup_site.purchasing_site_flag = 'Y' and sup_site.primary_pay_site_flag = 'Y') then 'Purchasing; Pay; Primary Pay' when (sup_site.pay_site_flag = 'Y' and sup_site.primary_pay_site_flag = 'Y') then 'Pay; Primary Pay' when (sup_site.pay_site_flag = 'Y' and sup_site.purchasing_site_flag = 'Y') then 'Purchasing; Pay' when (sup_site.purchasing_site_flag = 'Y' and sup_site.primary_pay_site_flag = 'Y') then 'Purchasing; Primary Pay' when (sup_site.purchasing_site_flag = 'Y') then 'Purchasing' when (sup_site.pay_site_flag = 'Y') then 'Pay' when (sup_site.primary_pay_site_flag = 'Y') then 'Primary Pay' when (sup_site.rfq_only_site_flag = 'Y') then 'Sourcing Only' else '' end Site_Purpose from poz_suppliers_v sup ,poz_supplier_address_v sup_addr ,poz_supplier_sites_v sup_site where 1 = 1 and sup_site.vendor_id = sup.vendor_id and sup_addr.vendor_id = sup_site.vendor_id and sup_addr.party_site_id = sup_site.party_site_id order by sup.vendor_name
Comments
Post a Comment