1) The below function which it was going to pick the multiple email ids from the customer screen for the bursting.
CREATE OR REPLACE FUNCTION GETEMAILS_APPS(p_header_id IN NUMBER) RETURN VARCHAR2
ISCREATE OR REPLACE FUNCTION GETEMAILS_APPS(p_header_id IN NUMBER) RETURN VARCHAR2
l_email_str VARCHAR2(2000) := NULL;
CURSOR lcu_get_emailsIS
SELECT hcp.email_address
FROM ont.oe_order_headers_all oha,
ar.hz_cust_account_roles hcar,
ar.hz_org_contacts hoc,
ar.hz_relationships hrel,
ar.hz_parties hp2,
ar.hz_contact_points hcp
WHERE oha.sold_to_contact_id = hcar.cust_account_role_id(+)
AND hcar.party_id = hrel.party_id(+)
AND hcar.role_type(+) = 'CONTACT'
AND hoc.party_relationship_id(+) = hrel.relationship_id
AND hrel.directional_flag(+) = 'F'
AND hrel.subject_table_name(+) = 'HZ_PARTIES'
AND hrel.object_table_name(+) = 'HZ_PARTIES'
AND hrel.party_id = hp2.party_id(+)
AND hcp.contact_point_type(+) = 'EMAIL'
AND hcp.contact_point_purpose = 'ACK'
AND hcp.owner_table_id(+) = hp2.party_id
AND hcp.owner_table_name(+) = 'HZ_PARTIES'
AND hcp.status(+) = 'A'
and oha.HEADER_ID = p_header_id;
BEGINFOR lr_get_emails IN lcu_get_emails
LOOPl_email_str := l_email_str || lr_get_emails.email_address ||',';END LOOP;l_email_str := SUBSTR(l_email_str,1,LENGTH(l_email_str)-1);RETURN (l_email_str);
EXCEPTION
WHEN
OTHERS THEN l_email_str := NULL;RETURN (l_email_str);
No comments:
Post a Comment