Home » SQL & PL/SQL » SQL & PL/SQL » Replace characters in a string using sql plus
Replace characters in a string using sql plus [message #298220] Tue, 05 February 2008 06:39 Go to next message
MarkGwilliam
Messages: 2
Registered: February 2008
Junior Member
I have approx 700,000 records containing a url within a CHAR field. I some how need to update part of the existing url within each field (the server name) to a new value. I am using sql plus and am a newbie to dba tasks. Can anyone point me in the right direction as to how I can achieve this?
Cheers
Mark
Re: Replace characters in a string using sql plus [message #298223 is a reply to message #298220] Tue, 05 February 2008 06:43 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Use the REPLACE function, such as
SQL> select replace('little.foot@old.hr', 'old', 'new') result
  2  from dual;

RESULT
------------------
little.foot@new.hr

SQL>
Re: Replace characters in a string using sql plus [message #298226 is a reply to message #298220] Tue, 05 February 2008 06:46 Go to previous message
MarcS
Messages: 312
Registered: March 2007
Location: Antwerp
Senior Member
Have a look at TRANSLATE & REPLACE functions as described here

Ok, Littlefoot beat me to it Wink

[Updated on: Tue, 05 February 2008 06:46]

Report message to a moderator

Previous Topic: Stop executing trigger
Next Topic: For Loop coding problem
Goto Forum:
  


Current Time: Fri Dec 09 05:59:01 CST 2016

Total time taken to generate the page: 0.11830 seconds