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

Home -> Community -> Usenet -> c.d.o.server -> Re: string manipulation

Re: string manipulation

From: Paul Drake <paled_at_home.com>
Date: Sun, 23 Sep 2001 16:55:03 GMT
Message-ID: <3BAE13DD.AB8A2AF4@home.com>


ed zappulla wrote:
>
> does any know how th replace the first char or a field with a string using
> sql plus?
>
> I want to take all "N FOOBAR" and make it "NORTH FOOBAR".

Ed,

rem hit them all
update my_table

   set this_column='NORTH'||substr(this_column,2) /

rem hit a subset
update my_table

   set this_column='NORTH'||substr(this_column,2)  where substr(this_column,1,1)='N'
/

rem another hit a subset
update my_table

   set this_column=replace(this_column,'N ','NORTH ')  where substr(this_column,1,2)='N '
/

take you pick.

Paul Received on Sun Sep 23 2001 - 11:55:03 CDT

Original text of this message

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