Igor Tandetnik wrote:
> 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?
>   
My collation does not compare the data as numbers but interpreted them 
in a different way. Comes from a bad data design :-)
>   
>> 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.
>   
The way the data is passed to the function is not a problem for me, but 
the fact that the function is not called if all the data is numerical.
> If for whatever reason you do want to compare numbers as strings, you 
> can write
>
> order by Cast(NumberColumn as string) collate MyCollation
>   
This is a very good idea! It might just give me back my weekend!
> Igor Tandetnik 
>
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>   

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

Reply via email to