Page 1 of 1

SQLite Case Insensitive LIKE for Unicode characters

Posted: Tue 24 Apr 2012 08:56
by Diamond
Please explain how to achieve case insensitive LIKE for non-ASCII characters with SQLiteUniProvider.

I've tried to add "COLLATE UniNoCase" after LIKE statement, but it didn't help. (DefaultCollations=True)

UniDAC version: 4.1.4
Delphi 2007 & Delphi XE

Posted: Tue 24 Apr 2012 11:10
by AlexP
Hello,

The Like method doesn't support Collation (more details on using the Collate are available at http://www.sqlite.org/datatype3.html in the Assigning Collating Sequences from SQL section). Therefore you should specify UTF symbols in both cases when using the Like method:

Code: Select all

WHERE (column like '%UTF_SYMBOL%' or column like '%utf_symbol%' )
or create and register your own user function for setting UTF-strings to upper/lower case and use it as

Code: Select all

WHERE MY_UPPER(column) like '%UTF_SYMBOL%'
You can find the information about creation of user functions in the TLiteUtils.RegisterFunction Method section of the help.