0% found this document useful (0 votes)
19 views2 pages

Supplier Detail Information - 2

The document contains SQL queries that retrieve distinct vendor and supplier information from various tables, including vendor names, legacy numbers, site codes, and contact details. It also includes subqueries to fetch related data such as payment methods and organization names. The results are ordered by vendor name and supplier number.

Uploaded by

Furqan Salam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

Supplier Detail Information - 2

The document contains SQL queries that retrieve distinct vendor and supplier information from various tables, including vendor names, legacy numbers, site codes, and contact details. It also includes subqueries to fetch related data such as payment methods and organization names. The results are ordered by vendor name and supplier number.

Uploaded by

Furqan Salam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

SELECT DISTINCT ASS.

VENDOR_NAME SUPPLIER_NAME
,ASS.ATTRIBUTE1 SUPP_LEGACY_NO
,ASS.SEGMENT1 ORACLE_SUPP_NO
,ASS.NUM_1099 TIN_NO
,ASS.VAT_REGISTRATION_NUM VAT_REGISTRATION_NUM
,(SELECT ALC.description FROM PO_LOOKUP_CODES ALC WHERE
ALC.lookup_type='VENDOR TYPE' AND ALC.lookup_code = ASS.VENDOR_TYPE_LOOKUP_CODE)
supplier_TYPE
,CONTACT.C_PHONE PHONE_NO
,CONTACT.C_EMAIL
,ASSA.VENDOR_SITE_CODE SITE_NAME
,ASSA.ADDRESS_LINE1||' '||
ASSA.ADDRESS_LINE2||' '||
ASSA.ADDRESS_LINE3 ADDRESS
,ASSA.CITY
,ASSA.COUNTRY
,(SELECT GCC.concatenated_segments FROM GL_CODE_COMBINATIONS_KFV GCC WHERE
GCC.code_combination_id = ASSA.PREPAY_CODE_COMBINATION_ID) Prepaymetn_Account
,(SELECT GCC.concatenated_segments FROM GL_CODE_COMBINATIONS_KFV GCC WHERE
GCC.code_combination_id = ASSA.ACCTS_PAY_CODE_COMBINATION_ID) Liability_Account
,(SELECT DISTINCT ieppm.payment_method_code
FROM ap_supplier_sites_all assa1,
ap_suppliers sup,
iby_external_payees_all iepa,
iby_ext_party_pmt_mthds ieppm
WHERE sup.vendor_id = assa1.vendor_id
AND assa1.pay_site_flag = 'Y'
AND assa1.vendor_site_id = iepa.supplier_site_id
AND iepa.ext_payee_id = ieppm.ext_pmt_party_id
AND ((ieppm.inactive_date IS NULL) OR (ieppm.inactive_date > SYSDATE)
)
AND assa1.vendor_site_id = assa.vendor_site_id
AND ieppm.primary_flag = 'Y') PAYMENT_METHOD
,(select rrh.routing_name from rcv_routing_headers rrh where
rrh.routing_header_id = ass.receiving_routing_id) receipt_routing
,(SELECT HAOU.NAME FROM HR_ALL_ORGANIZATION_UNITS HAOU WHERE
HAOU.ORGANIZATION_ID = ASSA.ORG_ID) ORG_NAME

/* ,ASSA.PURCHASING_SITE_FLAG
,ASSA.PURCHASING_SITE_FLAG
,ASSA.RFQ_ONLY_SITE_FLAG
-- ,(SELECT AL.location_code FROM AP_SHIP_BILL_TO_LOCATIONS_V AL WHERE
AL.location_id = ASSA.SHIP_TO_LOCATION_ID) SHIP_TO_LOC
-- ,(SELECT AL.location_code FROM AP_SHIP_BILL_TO_LOCATIONS_V AL WHERE
AL.location_id = ASSA.BILL_TO_LOCATION_ID) BILL_TO_LOC
,ASSA.PAY_GROUP_LOOKUP_CODE
,(SELECT ALC.description FROM AP_LOOKUP_CODES ALC WHERE ALC.lookup_type
='PAYMENT METHOD' AND ALC.lookup_code = ASS.PAYMENT_METHOD_LOOKUP_CODE)
PAYMENT_METHOD
,ASSA.TERMS_DATE_BASIS
,(SELECT ATL.NAME FROM AP_TERMS_VL ATL WHERE ATL.TERM_ID = ASSA.TERMS_ID)
TERM_NAME
,ASSA.INVOICE_CURRENCY_CODE
,ASSA.PAYMENT_CURRENCY_CODE

,ASSA.ALLOW_AWT_FLAG
,ASSA.MATCH_OPTION*/
-- ,CONTACT.c_party_name PARTY_NAME

FROM AP_SUPPLIERS ASS


,AP_SUPPLIER_SITES_ALL ASSA
,(
SELECT DISTINCT asu.vendor_id c_vendor_id
,assa.vendor_site_id c_vendor_site_id
,hpr.party_name c_party_name
,hpr.primary_phone_number c_phone
,hpr.email_address c_email
FROM
hz_relationships hr
,ap_suppliers asu
,ap_supplier_sites_all assa
,ap_supplier_contacts asco
,hz_org_contacts hoc
,hz_parties hpc
,hz_parties hpr
,hz_contact_points hpcp
WHERE hoc.party_relationship_id = hr.relationship_id(+)
AND hr.subject_id = asu.party_id
AND hr.relationship_code = 'CONTACT'
AND hr.object_table_name = 'HZ_PARTIES'
AND asu.vendor_id = assa.vendor_id
AND hr.object_id = hpc.party_id
AND hr.party_id = hpr.party_id
AND asco.relationship_id = hoc.party_relationship_id
AND assa.party_site_id = asco.org_party_site_id
AND hpr.party_type='PARTY_RELATIONSHIP'
AND hpr.party_id = hpcp.owner_table_id
AND hpcp.owner_table_name = 'HZ_PARTIES'
)CONTACT
WHERE ASS.VENDOR_ID = ASSA.VENDOR_ID
--AND ASS.VENDOR_ID = CONTACT.C_VENDOR_ID(+)
AND ASSA.VENDOR_SITE_ID = CONTACT.C_VENDOR_SITE_ID(+)
--AND ASS.VENDOR_NAME='Partex PVC Industries Limited.'

order by 1

--select * from tab where tname like '%ROUTE%'

=============

select haou.name, aps.attribute1 legacy_num, to_number(aps.segment1)


suppier_num,aps.vendor_name, apss.vendor_site_code,
apss.address_line1||' '||apss.address_line2||' '||apss.address_line3||' '||
apss.address_line4 vendor_site_addres
from ap_suppliers aps,
ap_supplier_sites_all apss,
hr_all_organization_units haou

where aps.vendor_id = apss.vendor_id


and apss.org_id = haou.organization_id

order by 1,3,4,5

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy