TLiteconnectio Options DefaultCollations

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
LHSoft
Posts: 130
Joined: Sat 18 Aug 2012 08:33

TLiteconnectio Options DefaultCollations

Post by LHSoft » Mon 17 Aug 2020 10:36

Hello,
I want to get NoCase Search or NoCase Order without setting this in SQL Statement.
Can I do this by setting this to False? And where I have to set the collation "UniNoCase"?

best regards
Hans

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: TLiteconnectio Options DefaultCollations

Post by MaximG » Fri 21 Aug 2020 15:42

You can set the use of the required Collection by default. This method is described in the official SQLite documentation : https://sqlite.org/datatype3.html#collation.
(7.1. Assigning Collating Sequences from SQL). When using the DefaultCollations option to compare unicode strings case-insensitively you can refer to such Collation using the name
'UniNoCase', for example :

Code: Select all

...
LiteConnection.Options.DefaultCollations := True;
LiteQuery.SQL.Text := 'CREATE TABLE MyTable(x INTEGER PRIMARY KEY, y COLLATE UniNoCase)';
LiteQuery.Execute;
...

LHSoft
Posts: 130
Joined: Sat 18 Aug 2012 08:33

Re: TLiteconnectio Options DefaultCollations

Post by LHSoft » Sat 22 Aug 2020 08:20

the simplest things are always hard to think of.
Thank you for your reply

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: TLiteconnectio Options DefaultCollations

Post by MaximG » Tue 25 Aug 2020 10:49

You're welcome. Feel free to contact us if you have any further questions.

Post Reply