Subject RE: [IBO] TIBOQuery: Can't get SqlOrder.add to work
Author Jason Wharton

I need to point out some corrections below.

> 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.

SQLOrder is similar to SQLWhere but not at all similar to SQLWhereItems.

SQLWhereItems is only meant for use during the OnPrepareSQL phase.

SQLWhere is a property to isolate control of the WHERE clause of the SELECT
statement and it includes the WHERE token.

> >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.

Sorry for my absence. I'm glad to report I have healed from my injury (for
the most part) and I am not ill either (for the most part). I was running
with a pick and had a mishap where I stumbled and fell on it and it cracked
a rib near my breastplate. I am not sure of that because I didn't have it
x-ray'd. I decided the doctor wouldn't do anthing about it even if it were
cracked but based on how sore it was for how long it was at least badly
bruised. I'm pretty sure my being ill was unrelated to the accident.

Also, on top of all this weirdness, our dogs flipped out and attacked our
pet icelandic ewe (female sheep) and we had to put them all down. This has
been a really rough past couple of weeks, as if things haven't already been
irritatingly challenging.

> >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?

There have been no changes in the functionality of SQLOrder. It has always
been designed to function to provide isolated control of the ORDER BY clause
of the SELECT statement and it has always included the ORDER BY portion of
the clause.

Jason Wharton