Subject Re: [IBO] IB_Query phenomenom
Author Jason Wharton
> > Yes, this solves the problem. This is the one limitation that I impose
on
> > people to have all of the benefits that IBO offers is to:
> >
> > DON'T PUT JOIN CRITERIA IN THE WHERE CLAUSE, EVER.
> >
> > Either use the JoinLinks property or use the FROM ... JOIN ...
declarative
> > syntax for JOINs.

> OK, I will do so. Can you briefly explain to me, why I should not put join
> criteria in the where clause ?

Yes, because IBO does a lot of internal parsing together of SQL statements
for various things and it needs to be able to distinguish between normal
WHERE clause stuff and that which is intended to create a JOIN between
relations. If you put JOIN criteria in a WHERE clause it gets lost in
internal statements because I strip off the where clause for certain things.
This leads to other problems that are detected by the multiple rows in
singleton fetch error. In other cases, such as yours, it results in
incorrect results from the query.

Regards,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com