Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Change text in a table
On Oct 24, 10:08 am, cqmman <cqm..._at_yahoo.co.uk> wrote:
> Hello, I want to replace a portion of a string value in columns in a
> table.
>
> Lets say I have a table called TABLE_TEST with something like this:
>
> value....................string value
> 1............................string1\string3
> 2............................string1\string4
>
> I want it to be like this:
>
> value....................string value
> 1............................string2\string3
> 2............................string2\string4
>
> Will the following work?
>
> UPDATE TABLE_TEST
> SET string_value =REPLACE(string_value,'string1','string2');
>
> I was also looking a SELECT REPLACE, but it seems like the above would
> work?
> Cheers
Why ask when you can try the statement?
If you do not want to update the target table till you know for sure your solution is working then either create some test data and try it in test or create some test tables with a little sample data and try it.
There is also the rollback command to prevent making the change permanent, providing you are not using a tool with autocommit set on.
HTH -- Mark D Powell -- Received on Wed Oct 24 2007 - 10:04:20 CDT
![]() |
![]() |