x wrote:
> int Compare(void* Data, int Len1, const void *s1, int Len2, const void *s2)
> {
> const UTF8String *S1 = static_cast<const UTF8String*>(s1),
> *S2 = static_cast<const UTF8String*>(s2);
> return 0;
> }
>
> if (sqlite3_create_collation(SQLiteDB, "Compare", SQLITE_UTF8, NULL,
> &Compare) != SQLITE_OK)
> throw Exception("Collation creation error");
>
> S1 and S2 appear to point to NULL values.
What is "UTF8String"? If it is anything different from "char", the code is
wrong.
> If I change the select to ‘select ID from IDTbl order by ID collate Compare’
> the Compare function is never entered.
> Is this because ID is an integer column?
No, it is because the values in that column are integer values.
> Is there no way to implement a custom collation on an integer column?
There is no way to implement a custom collation for integer values.
Collations are used only for string values.
Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users