Subject Re: [ib-support] Invalid Query or Bug ?
Author Claudio Valderrama C.
<hans@...> wrote in message news:3C6F0B2F.671C@......
>
> SELECT DISTINCT A,
> (SELECT Y.B FROM TABLE Y WHERE Y.B = X.A)
> FROM TABLE X
>
> produces following error
>
> ISC ERROR CODE:335544343
>
> ISC ERROR MESSAGE:
> invalid request BLR at offset ..
> context already in use (BLR error)

This has been the case since IB4.
I never got a clever answer from Diane Brown whether this should be allowed
or not. I think the engine is able to answer it, but the DSQL layer
generates the wrong BLR for the sentence. At least MsSql has no problem with
such sentence.

You can create a view without the DISTINCT and apply the DISTINCT when
selecting from the view. I think it works.

C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing