On 7 Feb 2019, at 5:02pm, li...@herger.net wrote: >> If you don't want to have to keep specifying the COLLATE, put it in the >> table definition: >> CREATE TABLE ... ( ... artist TEXT COLLATE de_DE ...) > > Thanks for the hint. But the application is localized to the user's language. > Therefore the collation can have different values.
This is currently a problem with SQLite. You can't specify a collation as a string or a variable. In other words, neither of the following work: *** CREATE TABLE ... ( ... artist TEXT COLLATE 'de_DE' ...) *** *** SELECT a FROM t ORDER BY a COLLATE 'de_DE' *** Also, if you use ALTER TABLE RENAME COLUMN other references to that column in the schema get changed accordingly. This makes it impossible to change a column's COLLATE easily. So you end up making your CREATE TABLE command in software once you know the preferred collation for that particular installation. The advantage of doing this is that it only needs to be done once, at installation or first run, and nothing else in your code needs to worry about which collation to use. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users