Re: Change text in a table



On 24 Oct, 16:04, Mark D Powell <Mark.Pow...@xxxxxxx> wrote:
On Oct 24, 10:08 am, cqmman <cqm...@xxxxxxxxxxx> 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.




Well yes good point. But I am not an expert in Oracle so don't want to
go around creating tables and stuff in a live DB (god knows how to
create a new Oracle DB, I don't without hitting the manuals!!).

I did actually try it using TOAD but couldn't see any useful output,
but I think that was because I the string I was looking for didn't
exist in the first place in that table..

Cheers

.



Relevant Pages

  • Re: Trade Press Needs to Talk with HP Disaster Tolerence Customers
    ... This isn't so much targeted at you Tom but everyone in cov... ... Keith is right on target. ... > Oracle from improving their professional marketing of these advanced ... > I have repeatedly discussed the scientific basis of the design advantages ...
    (comp.os.vms)
  • Re: rman connection authorization
    ... Copyright 1982, 2005, Oracle. ... C:\TEMP>rman target / nocatalog ... initialization of internal recovery manager package failed ... RMAN-04005: error from target database: ...
    (comp.databases.oracle.server)
  • Re: rman connection authorization
    ... Copyright 1982, 2005, Oracle. ... But connecting to rman requires me to spell it out ... ... initialization of internal recovery manager package failed ... RMAN-04005: error from target database: ...
    (comp.databases.oracle.server)
  • Re: rman connection authorization
    ... Copyright 1982, 2005, Oracle. ... Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production ... initialization of internal recovery manager package failed ... RMAN-04005: error from target database: ...
    (comp.databases.oracle.server)
  • Re: rman connection authorization
    ... Copyright 1982, 2005, Oracle. ... But connecting to rman requires me to spell it out ... ... initialization of internal recovery manager package failed ... RMAN-04005: error from target database: ...
    (comp.databases.oracle.server)