Subject Re: [firebird-support] Transactions
Author Helen Borrie
At 07:36 a.m. 13/04/2014, 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)

No JOIN criteria. JOIN has to join two sets (surprise!!). While it is possible to provide WHERE criteria in the ON sub-clause (sometimes with unexpected results), a search criterion is not a JOIN criterion.

At a minimum you need

Select P.product,SI.Rec_ID
FROM stores S,Products P
LEFT JOIN Stores_Inventory SI ON (S.Rec_ID = P.something)

and if you want the join value to be limited to Rec_ID =12 then provide the WHERE clause:

WHERE S.Rec_ID = 12

Helen Borrie, Support Consultant, IBPhoenix (Pacific)
Author of "The Firebird Book" and "The Firebird Book Second Edition"