• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

case insensitive search in Oracle

 
Bhiku Mhatre
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to fire SQL query which searches a string in particular column in case insensitive manner with Oracle database. In mysql like '%searchString%' works fine. But oracle does return results from the same case.
PLEASE HELP...
 
Veena Rani
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
convert searchString to upper case then query like
upper(column name) like '%serachString%'
Veena
 
John Carnell
Author
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bhiku Mhatre:
How to fire SQL query which searches a string in particular column in case insensitive manner with Oracle database. In mysql like '%searchString%' works fine. But oracle does return results from the same case.
PLEASE HELP...

Veena, is right however make sure you do UPPER() call on both sides of the SQL statement.
UPPER(col_name) like UPPER('%COL_NAME%');
Otherwise you are only converting to uppercase on the data retrieved and does not guarantee that the search string you are looking for is also upper cased.
Thanks,
John
 
Bhiku Mhatre
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help..
Regards,
Bhiku.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic