Subject Re: Pulling my hair out..
Author Dmitry Yemanov
12.04.2014 23:37, Gordon Hamm wrote:

> BTW, I took the code out, and made a simple query.. I stripped it down
> to nothing, and gives me an error of..
> "No current record for fetch operation"
>
> Im lost as to why this simple query wont work..
>
> Select P.product,SI.Rec_ID
> FROM stores S,Products P
> LEFT JOIN Stores_Inventory SI ON (S.Rec_ID =12)

You might think you join (S, P) to SI but in fact you join S with (P,
SI). So you cannot reference S inside the condition for a join of (P,
SI), because nobody guarantees that S will be read before (P, SI), it's
a completely independent stream. Wrong join order chosen by the
optimizer and you're out of luck getting "no current record to fetch".

Firebird 3 rejects such queries with a syntax error.


Dmitry