Page 1 of 1

TLiteconnectio Options DefaultCollations

Posted: Mon 17 Aug 2020 10:36
by LHSoft
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

Re: TLiteconnectio Options DefaultCollations

Posted: Fri 21 Aug 2020 15:42
by MaximG
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;
...

Re: TLiteconnectio Options DefaultCollations

Posted: Sat 22 Aug 2020 08:20
by LHSoft
the simplest things are always hard to think of.
Thank you for your reply

Re: TLiteconnectio Options DefaultCollations

Posted: Tue 25 Aug 2020 10:49
by MaximG
You're welcome. Feel free to contact us if you have any further questions.