The following lines contain the word 'select', 'insert', 'update' or 'delete':
| then select contact's primary phone |
| from hz_contact_points |
| 01-Oct-2002 Sanjeev K. use hz_relationships in place of |
| hz_party_relationships |
| hz_party_relationships is obsoleted. |
| 15-Oct-2002 cjang Fixed bug 2467845: |
| Modified the cursor c_phone_hz |
| to get the phone from relationship, |
| not from subject_id. |
| 30-Oct-2002 Chanik Jang Modified get_primary_email() |
| removed hz_relationships from cursor |
*=======================================================================*/
FUNCTION get_primary_phone (p_task_id IN NUMBER)
RETURN VARCHAR2
IS
CURSOR c_phone (b_task_id NUMBER) IS
SELECT decode(hcp.phone_country_code, NULL, NULL, '+'||hcp.phone_country_code||' ')||
'('||hcp.phone_area_code||') '||
hcp.phone_number||
decode(hcp.phone_extension, NULL, NULL, ' <'||hcp.phone_extension||'>') phone_number
FROM jtf_task_contacts jtc
, jtf_task_phones jtp
, hz_contact_points hcp
WHERE jtc.task_id = b_task_id
AND jtc.primary_flag = 'Y'
AND jtp.task_contact_id = jtc.task_contact_id
AND jtp.owner_table_name = 'JTF_TASK_CONTACTS'
AND jtp.primary_flag = 'Y'
AND hcp.contact_point_id = jtp.phone_id
AND hcp.contact_point_type = 'PHONE';
SELECT decode(hcp.phone_country_code, NULL, NULL, '+'||hcp.phone_country_code||' ')||
'('||hcp.phone_area_code||') '||
hcp.phone_number||
decode(hcp.phone_extension, NULL, NULL, ' <'||hcp.phone_extension||'>') phone_number
FROM jtf_task_contacts jtc
, hz_contact_points hcp
WHERE jtc.task_id = b_task_id
AND jtc.primary_flag = 'Y'
AND hcp.owner_table_id = jtc.contact_id
AND hcp.owner_table_name = 'HZ_PARTIES'
AND hcp.contact_point_type = 'PHONE'
AND hcp.primary_flag = 'Y';
SELECT hcp.email_address
FROM jtf_task_contacts jtc
, hz_contact_points hcp
WHERE jtc.task_id = b_task_id
AND jtc.primary_flag = 'Y'
AND hcp.owner_table_id = jtc.contact_id
AND hcp.owner_table_name = 'HZ_PARTIES'
AND hcp.contact_point_type = 'EMAIL'
AND hcp.primary_flag = 'Y';