Home » SQL & PL/SQL » SQL & PL/SQL » removed special characters
removed special characters [message #580305] Fri, 22 March 2013 11:15 Go to next message
RMSoares
Messages: 46
Registered: September 2010
Location: Lisboa
Member

Hi,
i nedd to removed special characters (!, ", #, $, %, &, /, () from a string, i have a table with sll this speciall charcaters and words that i ahnt to removed from the string.

How can i do that ?

i have a string with |R!$#&2-_D%2
and i whant to get R2-D2

SELECT '|R!$#&2-_D%2' as Original, 'R2-D2' as Correct
FROM DUAL


Any suggestions ?
Re: removed special characters [message #580306 is a reply to message #580305] Fri, 22 March 2013 11:22 Go to previous messageGo to next message
BlackSwan
Messages: 22470
Registered: January 2009
Senior Member
http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions216.htm#SQLRF06145
Re: removed special characters [message #580307 is a reply to message #580306] Fri, 22 March 2013 11:41 Go to previous messageGo to next message
RMSoares
Messages: 46
Registered: September 2010
Location: Lisboa
Member

Thanks for your awnser, but the translate expected a string

TRANSALATE('ORIGINALSTRING', 'CHARACTERS TO SUBSTITUTE' 'NEW CHAREACTERS')

and in the 'NEW CHAREACTERS' i get from a table

What i need is

TRANSALATE('ORIGINALSTRING', 'CHARACTERS TO SUBSTITUTE' <SELECT NEW_CHARACTER FROM MY_TABLE>)


Suggestions
Re: removed special characters [message #580309 is a reply to message #580307] Fri, 22 March 2013 11:49 Go to previous messageGo to next message
BlackSwan
Messages: 22470
Registered: January 2009
Senior Member
That certainly is an interesting "design".

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/


please provide adequate Test Case.
Re: removed special characters [message #580312 is a reply to message #580305] Fri, 22 March 2013 12:19 Go to previous messageGo to next message
Michel Cadot
Messages: 58477
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Any suggestions ?


With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Regards
Michel
Re: removed special characters [message #580329 is a reply to message #580312] Fri, 22 March 2013 15:45 Go to previous message
Littlefoot
Messages: 19289
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Have a look at this recent discussion.
Previous Topic: Insert in to Temporary Table - Record count mismatch between select & its corresponding bulk insert (4 merged)
Next Topic: SQL to transform a single row into multiple rows.
Goto Forum:
  


Current Time: Tue Jul 22 03:20:49 CDT 2014

Total time taken to generate the page: 0.12768 seconds