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 part of a text string using sql

Re: Replace part of a text string using sql

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 29 Nov 2002 12:24:37 +0100
Message-ID: <uufa0gfsg12r0f@corp.supernews.com>

"John Guthrie" <john_at_guthrie.co.za> wrote in message news:as7i01$ojasr$1_at_ID-156817.news.dfncis.de...
> Hi All,
>
> I am trying to update part of a text string in a Varchar2 Column.
>
> replace:
> somebody_at_domainname.com
> with
> somebody_at_domainname.co.uk'
>
> I tried using the following sql:
>
> update user set email = replace ('domainname.com', 'com', 'co.uk') where
> username like 'J%';
>
> This produced the following result, it chopped of the "somebody" part:
> domainname.co.uk
>
> instead of returning
> somebody_at_domainname.co.uk
>
> Any ideas?
> Thanks for the help!
>
> Regards,
> John Guthrie
>
>

You are using a hardcoded literal as argument to replace instead of a column

Hth Received on Fri Nov 29 2002 - 05:24:37 CST

Original text of this message

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