Subject no current record for fetch operation. (a little different)
Author Mitch Peek
FB 1.5 (this is an older version at this site 1.5.2 I think (V6.3.2.4731)

Actually, the full error is:

The cursor identified in the update or delete statement is not
positioned on a row.
no current record for fetch operation.


I know this is common when joining a table to a procedure and the order
in which the procedure is called. I also know this error is covered by
a faq :

http://www.firebirdfaq.org/faq144/



However, I am getting this error without a procedure involved.


1 select t.id as "INVOICE #",
2 ps.id as "ASSOC #",
3 ps.firstname as "FIRST NAME",
4 ps.lastname as "LAST NAME",
5 t.amount_Tendered as "SALE AMT",
6 cast (s.stocknumber as varchar(6)) as "STOCK #",
7 td.quantity as "QTY", td.price as "ORIG PRICE",
8 p.percentage as "% DISC",
9 (td.quantity*td.effectiveprice) as "PRICE PAID",
10 t.custzip as "REG #", pmtmethod.description as "PMT TYPE",
11 t.createdate as "DATE/TIME", t.item_total, t.tax,
12 t.Assoc_disc_id, p2.Lastname, p2.firstname, td.Assoc_Discount,
13 td.Sc_Disc, tt.Description
14 from transact t
15 join Transtype tt on tt.Id=t.Transtype_Id
16 left join transdetail td on t.store_id=td.store_id and
t.id=td.transact_id
17 left join person p2 on p2.id=t.Assoc_Disc_Id
18 join till tl on tl.store_id=t.store_id and tl.id=t.till_id
19 left join pricing p on p.id=td.pricing_id
20 join payment pm on pm.store_id=t.store_id and pm.transact_id=t.Id
21 join pmtmethod pmd on pmd.id=pm.pmtmethod_id
22 left join distribution d on d.id=p.distribution_id
23 left join stock2cat sc on sc.id=d.stock2cat_id
24 left join stock s on s.id=sc.stock_id
25 join person2type pt on pt.id=tl.cashier_id
26 join person ps on ps.id=pt.person_id
27 Where t.Store_id=16
28 and t.Assoc_Disc_ID is not null
29 and t.createDate Between current_date-1 and current_date
30 Order by t.id, td.id

interestingly, I can get the query to return a result in 3 separate
ways. I remove the restriction in the where clause " and
t.assoc_disc_id is not null " (line 28), or, by removing the second join
on " person ps " (line 26 and also the columns returned associated with
that table), or, by making the ps join a left join (Line 26).

Would 1.5.3 correct, or, is the workaround required?
Actually, I am downloading a backup of the DB now, so, in 6-8 hours, I
could have the DB restored and tested on 1.5.3.

I have seen no reference to this error that does not involve a stored
proc. Did I just miss it?

Thanks,
Mitch