Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: replace text
On Fri, 05 Mar 2004 15:08:05 -0800, Daniel Morgan <damorgan_at_x.washington.edu>
wrote:
>Jeff Kish wrote:
>
>> Greetings.
>>
>> I can't figure out how to use replace.. maybe I'm looking at it wrong.
>>
>> I need to replace all occurrences of 'abc1' with 'abc2' in columns fitting a
>> where clause (like this I imagine for table 'myAttributes':
>> replace ('abc1','abc2) in myAttributes where column1 = 'mycolumn1' and column2
>> = 'mycolumn2')
>>
>> Can someone tell me the right way to do this?
>>
>> Thanks
>> Jeff Kish
>
>The syntax you need is
>
>UPDATE <table_name>
>SET <column_name> = REPLACE(<column_name>, 'str1', 'str2');
>WHERE ...
>
>Check out: http://www.psoug.org/reference/translate_replace.html
Thanks Daniel.. the docs were not clear to me on this ! (this really helped
out). Nice web site. Now if I only lived there!
Jeff Kish
Received on Fri Mar 05 2004 - 17:33:39 CST