Subject Re: [IBO] Column orderding
Author Helen Borrie
At 09:42 AM 17/09/2004 +1200, you wrote:
>Hi All
>
>I am trying to use the IBOQuery.OrderingItems and IBOQuery.OrderingItemNo
>properties to all on the fly grid ordering in our custom grids (these are
>VCL / dataset grids).
>
>I load OrderingItems with the appropriate order using this code ...
>sFieldName + '=' + sFieldName + '; ASC ' (which I found in help somewhere)
>and set the OrderingItemNo to the number of the item.
>
>This seems to wor great for some fields but not for others. The grid
>display always changes but only items on an indexed field are actually shown
>in order. Am I doing somoething wrong?

Are you sure that is what you are really seeing? You should be able to
create an OrderingItem out of any column that is a database column. You're
likely to get performance problems on non-indexed columns, but any column
or combination of columns that is both valid in an ORDER BY clause and
accessible by name can be an OrderingItem. You do have to work strictly
within the rules for valid ORDER BY clauses.

I don't know of any way to access the ORDER BY <degree-number> syntax for
expression columns via an OrderingItem, which would be the only way to
order a set by such a column. Maybe this is what you are looking at.

Joining could have a similar effect, where you omitted the underlying table
identifier when defining the OrderingItem. For these cases, your SQL must
have fully-identified table names, as must your ordering and search
criteria. Some output columns in self-referencing joins would not be
available as OrderingItems because of the mandatory aliasing required by
the SQL syntax.

Helen