353:
354: --bug#4145213
355: CURSOR getRelationId IS
356: select relation.party_id party_id
357: from hz_parties relation
358: ,hz_parties person
359: ,hz_relationships hz
360: where relation.party_id = hz.party_id
361: and person.party_id = hz.subject_id
354: --bug#4145213
355: CURSOR getRelationId IS
356: select relation.party_id party_id
357: from hz_parties relation
358: ,hz_parties person
359: ,hz_relationships hz
360: where relation.party_id = hz.party_id
361: and person.party_id = hz.subject_id
362: and hz.subject_type = 'PERSON'
360: where relation.party_id = hz.party_id
361: and person.party_id = hz.subject_id
362: and hz.subject_type = 'PERSON'
363: and hz.object_type = 'ORGANIZATION'
364: and hz.subject_table_name ='HZ_PARTIES'
365: and hz.object_table_name ='HZ_PARTIES'
366: and person.party_id = p_external_contact;
367:
368: CURSOR ext_user_email(x NUMBER) IS
361: and person.party_id = hz.subject_id
362: and hz.subject_type = 'PERSON'
363: and hz.object_type = 'ORGANIZATION'
364: and hz.subject_table_name ='HZ_PARTIES'
365: and hz.object_table_name ='HZ_PARTIES'
366: and person.party_id = p_external_contact;
367:
368: CURSOR ext_user_email(x NUMBER) IS
369: SELECT hc.email_address
367:
368: CURSOR ext_user_email(x NUMBER) IS
369: SELECT hc.email_address
370: FROM hz_contact_points hc
371: WHERE hc.owner_table_name = 'HZ_PARTIES'
372: AND hc.primary_flag = 'Y'
373: AND hc.contact_point_type = 'EMAIL'
374: AND hc.owner_table_id = x;
375:
374: AND hc.owner_table_id = x;
375:
376: /*cursor ext_user_email is
377: select email_address
378: from hz_parties
379: where party_id=p_external_contact;*/
380:
381: CURSOR c_del_type(p_del_id IN NUMBER) IS
382: SELECT name