replace function question [message #383197] |
Tue, 27 January 2009 12:20  |
jjj0923
Messages: 4 Registered: January 2009 Location: pennsylvania
|
Junior Member |
|
|
I have a table with a field called email
some of the email fields have username@hotmial.com instead of username@hotmail.com and I would like to search for all addresses containing the string @hotmial.com and change that to @hotmail.com and not disturb the username in from of the @.
can someone give a pointer on how the replace function should be coded up?
thanks in advance.
jeff
|
|
|
|
|
Re: replace function question [message #383201 is a reply to message #383197] |
Tue, 27 January 2009 13:00   |
jjj0923
Messages: 4 Registered: January 2009 Location: pennsylvania
|
Junior Member |
|
|
I think I need to clarify something...
the string in front of the @ will be changing constantly, so I need to retain that and simply search for and replace certain strings after the @ sign
|
|
|
|
|
Re: replace function question [message #383276 is a reply to message #383197] |
Wed, 28 January 2009 01:17  |
wmgonzalbo
Messages: 98 Registered: November 2008
|
Member |
|
|
Another sample, compare the previous and output strings. Hope that helps.
with data as (select 'wilbert@hotmial.com, theresa@hotmail.com, matet@hotmial.com' e1 from dual)
select replace (e1,'@hotmial','@hotmail') as result from data
RESULT
wilbert@hotmail.com, theresa@hotmail.com, matet@hotmail.com
EDIT: Typo
Regards,
Wilbert
[Updated on: Wed, 28 January 2009 01:36] Report message to a moderator
|
|
|