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: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Fri, 05 Mar 2004 16:39:01 -0800
Message-ID: <1078533505.870339@yasure>


Jeff Kish wrote:

> 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

You don't have to be here to use the web site. Feel free to access the entire library from http://www.psoug.org ... click on Morgan's Library.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Fri Mar 05 2004 - 18:39:01 CST

Original text of this message

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