Home » SQL & PL/SQL » SQL & PL/SQL » how to replace & with and in the given string
how to replace & with and in the given string [message #395709] Thu, 02 April 2009 06:37 Go to next message
chaituu
Messages: 115
Registered: June 2008
Senior Member
i have 2 requirements .

1st one is how to replace & with and in the given string.

2nd requirement is in the given string if special characters appeared then except & remaining special characters replace with one space using regex_place;

for example

if AAA& AAAA LTD=AAA AND AAAA LTD.
if AAA# AAAA LTD=AAA AAAA LTD.
if AAA& DFCD% LTD=AAA AND DFCD LTD.

Re: how to replace & with and in the given string [message #395712 is a reply to message #395709] Thu, 02 April 2009 06:45 Go to previous messageGo to next message
Michel Cadot
Messages: 64098
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
how to replace & with and in the given string.

Use REPLACE

Quote:
Use several nested REPLACE or TRANSLATE if you just want to remove some characters.


Regards
Michel
Re: how to replace & with and in the given string [message #395714 is a reply to message #395709] Thu, 02 April 2009 06:51 Go to previous messageGo to next message
chaituu
Messages: 115
Registered: June 2008
Senior Member
if it is & with AND as you said we can use replace or translate but other than that if other special characters are used other than & then i need to replace with space.how to achive this with one shot?
Re: how to replace & with and in the given string [message #395729 is a reply to message #395714] Thu, 02 April 2009 08:25 Go to previous messageGo to next message
Michel Cadot
Messages: 64098
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Did you try to do it with REPLACE and TRANSLATE?
If yes, post what you did.
If no, do it.

Regards
Michel
Re: how to replace & with and in the given string [message #395746 is a reply to message #395714] Thu, 02 April 2009 09:08 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
The syntax for REGEXP_REPLACE is here]
Previous Topic: Trigger exception
Next Topic: Populating data into table type record and returning from procedure
Goto Forum:
  


Current Time: Fri Dec 02 12:06:22 CST 2016

Total time taken to generate the page: 0.13631 seconds