DCP
Wednesday, 7 September 2016
Query to retrieve all Supplier contacts in R12
SELECT org_pty.party_name,
per_pty.person_first_name,
per_pty.person_last_name,
pty_rel.email_address,
pty_rel.primary_phone_area_code||' '||pty_rel.primary_phone_number primary_phone_number,
decode(pty_rel.status, 'A', 'Current', 'I', 'Inactive') status
FROM hz_relationships hzrel,
hz_parties per_pty,
hz_parties org_pty,
ap_suppliers vnd,
hz_parties pty_rel
WHERE subject_type = 'ORGANIZATION'
AND per_pty.party_id = hzrel.object_id
AND hzrel.relationship_code = 'CONTACT'
AND org_pty.party_id = hzrel.subject_id
AND org_pty.party_id = vnd.party_id
AND pty_rel.party_id = hzrel.party_id
AND vnd.vendor_type_lookup_code LIKE '%'
AND (vnd.enabled_flag = 'Y' OR vnd.enabled_flag IS NULL)
AND nvl(vnd.end_date_active, SYSDATE+1) >= SYSDATE
AND pty_rel.status = 'A'
ORDER BY 1
Subscribe to:
Post Comments (Atom)
What is the point of this blog if you are unable to select and copy the content from it?
ReplyDeleteJust disable javascript in the site and then you can copy the code
ReplyDelete