ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From crmanoj <manojrathi...@gmail.com>
Subject Search for character '_', '%' wildcard characters using ibatis
Date Fri, 11 Dec 2009 08:42:32 GMT

I am developing a webapplication using Struts for which oracle is a backend.
For connectivity i am using iBatis. My application has a search page where
the user enters an id which inturn gets the data from DB. 
The primary key for table which i am using is of type 'VARCHAR'. The values
for this primarykey field can contain characters like '_', '%' which are
wildcard characters.
 
For example:
id                 name
user_1          Tom
user_2          Harry
 
Suppose if a user wants to search for all rows which has '_' in their
primary key, how do i get this in iBatis. In a normal sql query in oracle, i
can use the keyword 'ESCAPE' for escaping the special characters.
For eg: 
SELECT id,name FROM EMPLOYEE WHERE id LIKE '%\_%' ESCAPE '\'
 
How do i handle this in iBatis?.
 
I am using the method 'queryforlist' in java to get the data. 
In SqlMap, i am using <select> tag.
 
Thanks in Advance.
-- 
View this message in context: http://old.nabble.com/Search-for-character-%27_%27%2C-%27-%27-wildcard-characters-using-ibatis-tp26740551p26740551.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message