ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris O'Connell" <oconn...@gorillachicago.com>
Subject RE: Is there a way using Ibator to do a case-insensitive LIKE compare
Date Thu, 31 Jul 2008 22:28:30 GMT
What about a query with something like


Select * from table where upper(NAME_COLUMN) like '%input_variable%'



From: Robert Glover [mailto:robertgloverjr@yahoo.com] 
Sent: Thursday, July 31, 2008 5:10 PM
To: user-java@ibatis.apache.org
Subject: Is there a way using Ibator to do a case-insensitive LIKE compare


   Disclaimer:  I really, really like Ibator and use it in all my projects.

   A programmer has inherited one of my projects that uses Ibator.  He needs
to use Ibator to do some name comparisons on people's names.  For example, a
database column might contain  a value of "John .J. Hancock".  He wants to
use Ibator to do  a "LIKE" compare against "%HANCOCK%".  Unfortunately it is
Oracle 10i, not MySql.  So, no match results because Oracle is case
sensitive. (MySql is not case sensitive). 
     Short of modifying the java code that Ibator generates,  is there any
way  using Ibator to do the "LIKE"  as if the column in the database
contained "JOHN J. HANCOCK"  instead of "John .J. Hancock"? 
     I realize that one solution would be to create a VIEW of the TABLE that
had the column value upper-cased and then run the VIEW into an IBATOR
generation, but he would prefer not to have to do that.

Thanks in advance,
Robert (a bit Ibator fan)

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.5.10/1584 - Release Date: 7/31/2008
12:00 PM

View raw message