Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to update hz_contact_points.email_address

timberry - oracleJul 26 2011 — edited Aug 2 2011
I need some help with an update query. I am trying to update hz_contact_points.email_address to append a comma then the source_email field from jtf_rs_resource_extns to it. So if the existing value in hz_contact_points.email_address field is 'tim.berry@oracle.com', and the value in source_email in jtf_rs_resource_extns is 'todd@oracle.com', the resulting value in hz_contact_points.email_address would be 'tim.berry@oracle.com,todd@oracle.com'. I have medium level sql skills. Here is the query I am trying that is not working:

update hz_contact_points g
set g.email_address = g.email_address||','||f.source_email
where f.source_email in
(select f.source_email
from hz_relationships a, hz_parties b, hz_cust_accounts d, hz_contact_points e, jtf_rs_resource_extns f
where d.party_id = a.object_id
and a.party_id = b.party_id
and e.owner_table_id = a.party_id
and e.primary_flag = 'Y'
and e.status = 'A'
and e.email_address is not null
and f.resource_id = d.attribute4
and d.account_number = 12544)

I get an error that f.source_email is an invalid identifier. I have the last statement d.account_number = 12544 to test this for just one account first - I will take it out when the sqil is correct and I want to run the update for every account.

Thanks! Tim Berry
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 30 2011
Added on Jul 26 2011
8 comments
4,220 views