146: decode(cont_point.contact_point_type,'TLX',
147: cont_point.telex_number, cont_point.phone_number)
148: from
149: hz_contact_points cont_point,
150: hz_cust_account_roles car
151: where
152: car.party_id = cont_point.owner_table_id
153: and cont_point.owner_table_name = 'HZ_PARTIES'
154: and cont_point.contact_point_type not in ('EDI','EMAIL','WEB')
154: and cont_point.contact_point_type not in ('EDI','EMAIL','WEB')
155: and car.cust_acct_site_id = address_id
156: and ( car.cust_account_role_id = c_contact_id
157: OR not exists ( select 'x'
158: from hz_cust_account_roles p2
159: where p2.cust_acct_site_id = car.cust_acct_site_id
160: and p2.cust_account_role_id = car.cust_account_role_id
161: )
162: )
169: decode(cont_point.contact_point_type,'TLX',
170: cont_point.telex_number, cont_point.phone_number)
171: from
172: hz_contact_points cont_point,
173: hz_cust_account_roles car
174: where
175: car.party_id = cont_point.owner_table_id
176: and cont_point.owner_table_name = 'HZ_PARTIES'
177: and cont_point.contact_point_type not in ('EDI','EMAIL','WEB')
177: and cont_point.contact_point_type not in ('EDI','EMAIL','WEB')
178: and car.cust_account_id = customer_id
179: and not exists (
180: select 'x'
181: from hz_cust_account_roles p2
182: where p2.cust_acct_site_id = car.cust_acct_site_id)
183: and rownum = 1
184: ;
185:
229: into
230: l_contact_name,
231: l_contact_id
232: from
233: hz_cust_account_roles acct_role,
234: hz_parties party,
235: hz_relationships rel,
236: hz_role_responsibility role_res
237: where