I understand that completely. However, I can't control the value of the string. I wish i could filter it in php/java but I have no control over it and it has to be done at the sql level.
Any idea how?
Main Topics
Browse All TopicsI have a string variable NAME: " 'name1','name2','name3','n
If I do
select translate('NAME','!@#$%^',
to replace all of the characters to spaces it doesn't work because it translates to
select translate(' 'name1','name2','name3','n
If I remove the single quote in front of name
select translate(NAME,'!@#$%^',' ') from dual
it will not work either because it will treat name2 as second parameter
select translate( 'name1','name2','name3','n
I do not have control on what user can input. Please let me know how can I handle it at the sql level
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
How about using a function:
http://articles.techrepubl
I miss understood your question at first. I don't have access to PL/SQL, but what about something like
select translate("NAME", '!@#$%^',' ')
Don't forget that translate wants a character to translate too for every character to translate from, in your case, you want a space for every character you're replacing.
Business Accounts
Answer for Membership
by: angelIIIPosted on 2009-09-15 at 15:00:51ID: 25340062
your "test" must be like this: a single quote inside a string must be "doubled", but that is SYNTAX ONLY.
2 single quotes inside a string result in actually 1 single quote as result.
Select allOpen in new window