Subject Re: [IBO] TIBOQuery modify Order affects Params
Author teamtlas
Thanks for your replies.

Perhaps I should clarify a couple of things as you have misundertsood
my problem somewhat...

> you are forcing IBO to invalidate your SQL by replacing the ORDER BY
>clause with another (identical) ORDER BY clause.

... the sample code I supplied is just a quick and dirty illustration
of how to reproduce the problem. It is *NOT* the actual production
code but exhibits exactly the same problem. The multiple executions of
the query are seperated by user actions in the real situation and the
'order by' clause is built according to the users request. The order
by clause can be ascending or descending (as in my example) and may
use any one of several columns present in the select. Please note that
whatever the apparent merits or otherwise of the sample code, if I
were to substitute Delphi components or InfoPower TwwQuery (as in our
production applications) there is no problem.

> If you don't need to change the ORDER BY clause, don't touch it!!

... Changing the 'order by' is the whole point of the exercise - the
user selects different sorted views of the data.

> Can't imagine why you are doing it
> twice in your sample code *at all*.

See above.

> Leave OrderingItems etc. alone until you're done with your
> conversion. They are IBO-only features with no equivalent in the
BDE. Use
> them when you're ready to look at better ways to manipulate sorts.

Will do.

I guess my main frustration is that modifying the 'order by' SQL
dynamically and repeatedly in my applications has worked fine for the
last 6 years until I converted to IBO. I am looking for at least a
quick and dirty method to get my apps working until I'm >>ready to
look at better ways to manipulate sorts<<

Having to do some rearrangement of code to get things working again is
not a problem, I am just confused about what I need to do.

Regards,

Mark H


>
> Helen
>
> At 03:38 AM 29/10/2003 +0000, you wrote:
>
>
> >with IBOQuery1 do
> > begin
> > close;
> > Params[0].AsInteger := 0;
> > Params[1].AsInteger := 999999999;
> > Params[2].AsDateTime := Date;
> > Params[3].AsString := '';
> > Params[4].AsString := 'zzzzzzzzzzzzzzzzzzzz';
> > Params[5].AsInteger := 0;
> > Params[6].AsInteger := 999999999;
> > Params[7].AsString := 'B';
> > SQL[10] := 'ORDER BY O.ODESC ASC';
> > open;
> > close;
> > Params[0].AsInteger := 0;
> > Params[1].AsInteger := 999999999;
> > Params[2].AsDateTime := Date;
> > Params[3].AsString := '';
> > Params[4].AsString := 'zzzzzzzzzzzzzzzzzzzz';
> > Params[5].AsInteger := 0;
> > Params[6].AsInteger := 999999999;
> > Params[7].AsString := 'B';
> > SQL[10] := 'ORDER BY O.ODESC DESC';
> > open;
> > end;
>
>
> >The TIBOQuery SQL is set at design time as...
> >
> >SELECT O.ODESC, I.INVID, I.INVREVIEWED, I.INVOID, I.INVREVDAYS,
> > I.INVPLANNER, I.INVSOURCE, I.INVVAR, O.ODOC FROM Invi I
> > JOIN Objects O ON O.OID = I.INVOID
> > WHERE I.INVSOURCE <> 'NP'
> > AND I.INVPLANNER >= :FUser AND I.INVPLANNER <= :TUser
> > AND (I.INVREVIEWED + I.INVREVDAYS) <= :TDate
> > AND I.INVCONTROL = 'Y'
> > AND I.INVID >= :FItem AND I.INVID <= :TItem
> > AND O.OCLASS >= :FClass AND O.OCLASS <= :TClass
> > AND O.ODESC CONTAINING :Desc
> > ORDER BY O.ODESC
> >
> >I have played around with using the OrderingItems/OrderingItemNo
> >properties instead of modifying the SQL directly but still get the
> >same problem.
> >
> >What am I missing here?
> >
> >
> >
>
>_____________________________________________________________________
______
> >IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
> > without the need for BDE, ODBC or any other layer.
>
>_____________________________________________________________________
______
> >http://www.ibobjects.com - your IBO community resource for Tech
Info papers,
> >keyword-searchable FAQ, community code contributions and more !
> >
> >Your use of Yahoo! Groups is subject to http://docs.yahoo
com/info/terms/