Tuesday, 10 July 2018

Oracle apps + Query to get Customer Contact details

18 comments
select account_number "Account Number"
     , obj.party_name "Customer Name"
     , sub.party_name "Contact Name"
     , hcp.contact_point_type || ': ' ||
       DECODE(hcp.contact_point_type, 'EMAIL', hcp.email_address
                                    , 'PHONE', hcp.phone_area_code || ' ' || hcp.phone_number
                                    , 'WEB'  , hcp.url
                                    , 'Unknow contact Point Type ' || hcp.contact_point_type
             ) "How to Contact"
  from apps.hz_cust_accounts  hca
     , apps.hz_parties        obj
     , apps.hz_relationships  rel
     , apps.hz_contact_points hcp
     , apps.hz_parties        sub
 where hca.party_id           = rel.object_id
   and hca.party_id           = obj.party_id
   and rel.subject_id         = sub.party_id
   and rel.relationship_type  = 'CONTACT'
   and rel.directional_flag   = 'F'
   and rel.party_id           = hcp.owner_table_id
   and hcp.owner_table_name   = 'HZ_PARTIES'
   and hca.account_number=1258;

Thanks
Amar Alam

Friday, 5 January 2018

Query to Get Organization Location Details

3 comments
SELECT  ood.organization_code ,
        ood.organization_name,
        hou.name,
        hou.address_line_1,
        hou.country,
        hou.town_or_city
FROM org_organization_definitions ood,
     hr_organization_units_v hou
WHERE ood.disable_date IS NULL
AND ood.organization_id    = hou.organization_id;

Your's
Amar Alam