File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes How to use underscore as literal not as wild char Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Reply locked New topic
Author

How to use underscore as literal not as wild char

cute nonni
Greenhorn

Joined: Jan 02, 2012
Posts: 7
Hello dears,


I'm using oracle and need to use the underscore as literal not as wild char in qurery

I found on the internet something like this




and if there is SAMPLE_NAME equales ABC_XYZ it will be feached


but in my case the string that i compare to is variable(entred by user)



Is there any way to disable using '_' as wildchar in general in queris???

or the only solution is to process user input before using it in LIKE statement !

thanks in advance
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18113
    
    8

That looks like it's a duplicate of this post: http://www.coderanch.com/t/589575/JDBC/databases/underscore-as-literal-not-as... so let's keep that as the active thread and close this one.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use underscore as literal not as wild char
 
Similar Threads
using wildcards literally in queries
problem in generating query in MSAccess
How to use underscore as literal not as wild char
Fetching values from the database
Get dialect from session (for character escaping)