Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: string manipulation
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