Subject RE: [firebird-support] Error: "no current record for fetch operation"
Author Leyne, Sean
Andrei,

> I get this error when running the query below in Firebird 1.5 RC3.

What error???


> The same query on the same data works fine in Interbase 6.01.
>
> SELECT
> t2.EE_NBR,
> t4.CO_NBR,
> t3.AMOUNT,
> t4.WORKERS_COMP_WAGE_LIMIT,
> t3.RATE_NUMBER,
> t3.CL_E_DS_NBR,
> t5.E_D_CODE_TYPE,

(Did you really mean to leave the extra comma ','?)

> FROM
> Pr_Check_Hist('now') t2,
> Pr_Check_Lines_Hist('now') t3,
> Ee_Hist('now') t4,
> Cl_E_DS_Hist('now') t5
> WHERE
> t2.PR_CHECK_NBR = t3.PR_CHECK_NBR AND
> t5.CL_E_DS_NBR = t3.CL_E_DS_NBR AND
> t2.PR_NBR = 5 AND
> t4.EE_NBR = t2.EE_NBR AND
> t3.PR_NBR = 5 and
> t5.E_D_CODE_TYPE LIKE 'E%';

You should probably start using the SQL-92 JOIN syntax (you used the
SQL-89 syntax)

What happens if you try:

SELECT
t2.EE_NBR,
t4.CO_NBR,
t3.AMOUNT,
t4.WORKERS_COMP_WAGE_LIMIT,
t3.RATE_NUMBER,
t3.CL_E_DS_NBR,
t5.E_D_CODE_TYPE
FROM Pr_Check_Hist('now') t2
JOIN Pr_Check_Lines_Hist('now') t3 on t3.PR_CHECK_NBR =
t2.PR_CHECK_NBR
JOIN Ee_Hist('now') t4 on t4.EE_NBR = t2.EE_NBR
JOIN Cl_E_DS_Hist('now') t5 on t5.CL_E_DS_NBR = t3.CL_E_DS_NBR
WHERE
t2.PR_NBR = 5 AND
t3.PR_NBR = 5 and
t5.E_D_CODE_TYPE LIKE 'E%'


--
Sean Leyne

- FirebirdSQL Foundation, Sponsor - Silver Level
- FirebirdSQL Foundation, Member
- FirebirdSQL Project Admin (one of many)
http://www.FirebirdSQL.org