Subject Re: [IBO] TIBOQuery: Can't get SqlOrder.add to work
Author mitch_landor
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
>
> At 11:30 PM 15/12/2007, you wrote:
> >> I notice you don't clear the SQLOrder array before you apply the new
> >ordering criteria. Possibly docline.item_order is already in the
> >array from the previous prepare?
> >>
> >I am closing the dataset elsewhere beforehand and the Getting Started
> >Guide says
> >"SQLOrder.Clear is unnecessary because Prepare will do it
> >automatically".
>
> Yes, actually, now I do recall that SQLOrder never did work quite
like SQLWhereItems, although it was meant to. That is, doing a Clear
and then adding the content of the phrases without the syntax elements
would not work.
>
> >The code below seems to work. I have also added
> >spaces and commas as necessary, which is not mentioned as necessary in
> >the Getting Started Guide.
>
> If that works, then well and good for now. I've sent Jason a
message about but he has replied that he is ill and will look at it
when he feels well enough.
>
> >Can you confirm that "Order By" must always
> >be explicitly added (as in SQLOrder.Add('order by ')), or can this be
> >automatically added by the prepare process and am I missing something?
>
> It shouldn't; but if that's what it takes to get it to work, then
we're looking at either a bug or an undocumented change in the parser.
As this hasn't popped up before, it's possibly quite recent. Could
you please post the exact version of IBO where you first saw this problem?
>
> The quote below used to be the way it was meant to work...at some
point, it worked only if you cleared SQLOrder and then added the
entire phrase of the order clause as one string...I believe that was
later fixed....but, until now, your statement would fail to prepare if
you included the keywords.
>
> So I think we do need Jason to check it over, as to whether this
change was intended...for example, it might be now, with Fb 2.0's
changes, that the parser doesn't handle that phase quite the way it
did before. The GSG hasn't been updated for a very long time...
>
> Sorry I can't be more help here.
>
> Helen
>

Thanks very much Helen.

I'm using IBO 4.6.B. as you advised to some time ago.
I'm not sure if there has been a more recent stable version?

Mitch