TFDSQLiteCollation = class (TFDSQLiteService)
class PASCALIMPLEMENTATION TFDSQLiteCollation : public TFDSQLiteService
The class implementing a custom SQLite collation.
Use the TFDSQLiteCollation to register a custom SQLite collation. A registered collation then may be used in any place in a SQL command where a collation may be specified.
SELECT * FROM "Employees" ORDER BY LastName COLLATE UTF16NoCase
Each collation must have a unique name specified by CollationName and one of the three kinds of collation specified as the additional properties:
- CollationKind = scCompareString. To set up its properties, use the LocaleName and Flags properties. Depending on the platform, the collation will use :
- CollationKind = scCustomUTF8. To compare the application strings, the user should use the OnCompare event, which will receive strings in UTF8 encoding.
- CollationKind = scCustomUTF16. Similar to scCustomUTF8, but strings will be in UTF16 encoding.
After setting up the collation, it must be activated using the Active property. To use a collation in a SQLite connection, the application must activate the collation before opening a database connection.