Subject Re: Parser messes up SQL containing FIRST
Author aleksander_oven
Tim,

> There's a problem in your SQL string. What does the SQL string hold at
> this stage?

Well, as I said in my initaial post - the SQL I put in is really so
simple it couldn't be any simpler.

I put in this:

SELECT FIRST 1 * FROM Table WHERE (ID = 1)

But the Prepare call managed to transform my input into this:

SELECT FIRST 1 *
, Table.RDB$DB_KEY
FROM Table WHERE (ID = 1)

Incidentally, I checked and this error pops up even if I remove the
WHERE portion, leaving just this:

SELECT FIRST 1 * FROM Table

I believe this must be IBO's fault, because this very same statement
works like a charm with IBX (checked) and IB Expert (also checked).

However, with IBO, I can reproduce the exception even at design time,
by opening the IBOQuery's SQL editor, typing in the above SQL
statement and clicking the Prepare button.

Kind regards,
Aleksander Oven