Martin Engelschalk
<engelsch...@codeswift.com> wrote:
> The problem appeared when my users eliminated leading blanks from the
> data.

I'm not sure I understand. What does this have to do with collating 
numbers? Are you saying you were storing numbers as strings, with 
leading blanks, and had a collation function to actually compare them as 
numbers? Why?

> Is it a good idea that the actual type of the data influences whether
> it is compared with the collaction function or not?

Well, collation functions as they exist today take char* or wchar_t* as 
a parameter, and no type information. How would you pass a number to it? 
Maybe it would have been wise to design them to accept sqlite3_value* 
pointers as parameters, the way custom functions do. But that wasn't 
done, so it is what it is.

If for whatever reason you do want to compare numbers as strings, you 
can write

order by Cast(NumberColumn as string) collate MyCollation

Igor Tandetnik 



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to