Subject Re: [IBO] Change sort order to some custom logic
Author Helen Borrie (TeamIBO)
At 09:49 AM 10-06-02 +0000, you wrote:
>Hi everyone,
>
>my application currently uses the default ordering options to display
>the contents of a table in a grid. The field to be used for sorting
>is a character field in the database.
>
>Unfortunately, in some cases this field may contain digits only, in
>which case the sort order produces a correct, but unusual order, e.g.
>1,10,12,2,20,21,...
>I would like to change the way sorting is handled. Two options seem
>to be appropriate:
>1st: change the sort logic in the database (collation order). Will
>IBO properly use that order (I know that IBO does some sorting on its
>own). Is there a setting that sorts digit-only rows like numbers and
>non-digit rows alphabetically?

Collation order won't affect the sort order of alphanumeric digits in text
columns. They are just characters like any other - so '10' is just '1'
followed by '0'. Collation order affects the sequence in which alphabetic
characters are sorted and, in some cases, whether upper case and lower case
character pairs are treated as if they were the same.

>2nd: change the OnCompareText method to overwrite the sorting in IBO.
>Does this really affect all sorting options? Does IBO never use FB's
>ORDER BY clause then?

I'm not familiar with this method; but AFAIK, IBO *always* needs to use an
ORDER BY clause to sort datasets, doesn't it?

I think that the only way you can get these values to sort in a "numerical"
sequence is to store them that way: '0001', '0010', etc.


regards,
Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at
www.ibobjects.com