Subject IBOQuery - newbie alert
Author Laurie McIntosh
Hi all,

BDS2006
FB2
IBO 4.3.A

I'm creating IBOQuerys, and I'm finding if the index selected in the
plan doesn't have all of its key fields represented in the query's
field set, it throws its nana. I'm connecting to a Firebird 2.0 database.

I've got a whole heap of queries of this type:

SELECT EXTRACT (WEEKDAY FROM SAILDATE) AS SAILDOWORD,
DOW (SAILDATE) AS SAILDOWDESC,
COUNT (SAILDATE) AS SAILINGS,
CAST (SUM (PAX) AS INTEGER)AS PAX,
FROM SAILINGDATA
WHERE SAILDATE BETWEEN :D1 AND :D2
AND DEPARTUREPOINT = :P

GROUP BY 1, 2
ORDER BY 1


The PLAN looks like
PLAN SORT (SORT ((SAILINGDATA INDEX (PK_SAILINGDATA))))
This index comprises two fields: SAILDATE and BRSFRSCB.

If I try and compile as is, I get a complaint that field SAILDATE is
not found in the query. If I add two calculated fields called SAILDATE
and BRSFRSCB, and ignore those fields, my app will compile and the
query will run normally.

Similarly, if I have a query of the type
SELECT COUNT(BKMFBNUM)AS NOBOOKINGS FROM BM,
where BKMFBNUM is an index, I get the same complaint. If I change my
statement to read AS BKMFBNUM the complaining stops.

Now, I'm probly doing something wrong. How does one avoid these errors?

Also, my setup is along the lines of
IBOQuery -> dataSetProvider -> clientDataSet -> dataSource

... and I think I saw someone in another thread frown at this sort of
setup. Is this bad? Why? I'm enjoying the convenience of some of the
clientDataSet features, but I need to make this work properly.

Regards,

---=Laurie