|Subject||RE: [IBO] Random "field not found" errors|
|Author||IBO Support List|
This is likely due to using STATE instead of “STATE”.
This is a reserved word that needs special treatment.
I recommend that you rename it to something else.
Sent: Wednesday, May 11, 2016 10:17 AM
Subject: [IBO] Random "field not found" errors
since a few releases I'm getting some "field not found" errors by using a IB_Cursor. It happens randomly, so I can't say exactly when it started. My feeling is with the release Version 5.7.7 [Build 2340], but not sure.
I'm using some IB_Cursors to gather some data for a dashboard: counts, sums etc. There are SQL statements like these, for instance:
with IB_Cursor1 do begin
SQL.Add('select count(ID) as SOMECOUNT, STATE');
SQL.Add('where (ID > 0) and (STATE > 0)');
SQL.Add('group by STATE);
count(TABLE_A.ID) as SUM_ID
inner join TABLE_B on TABLE_A.ID = TABLE_B.REF_ID
TABLE_A.ID > 0 and TABLE_B.STATE = 3
sum(TOTAL) as SUM_TOTAL
(TABLE_A.ORDER_DATE >= :DATE_FROM) and (TABLE_A.ORDER_DATE < :DATE_TO) and (ID > 0)
Sometimes when I open that dashboard, I'm getting errors like
"Field SOMECOUNT not found"
"Field SUM_ID not found"
"Field SUM_TOTAL not found"
When I close the dashboard / the application and open / start it again, if often works with the same data, the same code the same everything. Sometimes it needs 2-3 more attempts, sometimes it works directly at the first attempt / start.
Not idea what is going on. It happens randomly and it happens with the current release as well (Version 5.7.11 [Build 2388]). Never had such problems with older versions.