Subject [IBO] Re: Actual field names
Author send2iwan
hi,

i am trying with IBO 4.8.7. it only works with one ordering items, if
more than one can not.

OrderingItems:
1=1;1 DESC
2=2;2 DESC
OrderingLinks:
MyAliasName1=1
MyAliasName2=2

error comes isc error code:335544569

invalid column position used in order by clause.

sql error -104

am i wrong? how to fix it?

thanks


--- In IBObjects@yahoogroups.com, Svein Erling Tysvaer
<svein.erling.tysvaer@...> wrote:
>
> Actually, Russell, Lucas suggestion is what you need (with a slight
> twist). Did you know that instead of using
>
> OrderingItems:
> MyFieldName=MyFieldName;MyFieldName DESC
> OrderingLinks:
> MyFieldName=1
>
> you can use
>
> OrderingItems:
> 1=1;1 DESC
> OrderingLinks:
> MyAliasName=1
>
> The only thing your users have to learn is to click the mouse
button and
> IBO does the ordering for you.
>
> Set
>
> russellbelding wrote:
> > Hello Luc
> > Thanks for your suggestion. What you do is exactly what I am
doing.
> > Unfortunately GetFieldNamesList (IBO 4.3Aa) (used after a
> > query.prepare or after query.active=true) returns field alias
names
> > when they are used, the same as grid.GridFields.
> > So I think I will use SET's suggestion and ask the users to learn
a
> > little more SQL.
> > Thanks, Russell.
> >
> > --- In IBObjects@yahoogroups.com, Lucas Franzen wrote:
> >> I do something like this in my database browser app:
> >>
> >> procedure AddQryOrderFields;
> >> var
> >> ii: Integer;
> >> sl: TStringList;
> >> begin
> >> // Add all query fields to the OrderingItemszulassen
> >> sl := TStringList.Create;
> >> with YourQry do
> >> begin
> >> OrderingItems.Clear;
> >> OrderingLinks.Clear;
> >>
> >> // add all query fields to the stringlist
> >> GetFieldNamesList ( sl ); // method of IB_Statement
> >>
> >> for ii := 0 to sl.Count - 1 do
> >> begin
> >> // add ordering item for ASCENDIMNG & DESCENDING
> >> OrderingItems.Add ( sl[ii] + '=' + sl[ii] + ';' +
> >> sl[ii] + ' DESC' );
> >> // set the appropriate OrderingLink
> >> OrderingLinks.Add ( sl[ii] + '=' + IntToStr ( ii + 1 ) );
> >> end;
> >>
> >> sl.Free;
> >> end;
> >>
> >>
> >> Luc.
>