In a J2EE project, using JPA, how can I force a like query to be case insensitive and accent insensitive?
I know about changing session variables NLS_COMP and NLS_SO
Crudely, you can do something like
select upper(convert('This is a têst','US7ASCII')),
upper(convert('THIS is A test','US7ASCII'))
from dual;
select 1 from dual
where upper(convert('This is a têst','US7ASCII')) =
upper(convert('THIS is A test','US7ASCII'))
The CONVERT reduces the accented characters to the mapped ASCII equivalent, and the UPPER forces lower case to uppercase. The resultant strings should be matchable.