SQLite Case Insensitive LIKE for Unicode characters

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Diamond
Posts: 2
Joined: Sat 20 Sep 2008 08:17
Location: Perm, Russia

SQLite Case Insensitive LIKE for Unicode characters

Post by Diamond » Tue 24 Apr 2012 08:56

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 24 Apr 2012 11:10

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.

Post Reply