Hi, Is there a way I can make SQL queries case-insensitive in the select statement itself ? I'm passing user entered values to a prepared statement. My select statement looks like : SELECT EMPNO,EMPNAME FROM EMPLOYEE WHERE EMPNAME LIKE ? I'm using preparedStatement.setString(1,inputValue). Instead of modifing the inputValue with String class(ie,changing its case to format it to Mallika or Kumar,ie first letter capitalized and the rest in small case), can I specify in select statement itself to ignore the case of inputValue being passed ? Any suggestions would be helpful. Thanks.
posted 15 years ago
you can use the UPPER or LOWER functions to put everything in the same case. The best thing to do is put it the way you need it in the database and use the upper/lower on the incoming data. If you use it on the database side I think the indexes will not be used. ex: where name = upper(clientside_name) Dan