Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: replace text

Re: replace text

From: Jeff Kish <jeff.kish_at_mro.com>
Date: Fri, 05 Mar 2004 18:33:39 -0500
Message-ID: <vv2i40pu0q65fqd4m2au3q2b0b5oikd9m5@4ax.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US