Subject [IBO] Problem setting filter to TIB_Query
Author Antti Kurenniemi
Hi all,

I have a customers table, where customers can have any number of
classifications (customer classes). This is done by having the classes in
another table, and a connector table CustToClass with fields custid and
classid. To get a list of all customers belonging to given classes, I would
do something like:

SELECT id, name FROM customer WHERE id IN
(SELECT custid FROM custtoclass WHERE classid IN (1, 2, 3))

Performance issues aside (though let me have it if this is all nuts, I'm
willing to learn ;-), this works.

Now I have a window in an app where I need to set a filter based on the
abovementioned fashion. I suppose I could do it also by creating the query
anew instead of making such a funny filter, but my question is, should it
work as a filter? Because with IBO 4.6A it doesn't - the filter string is
parsed somewhere, and becomes as follows:

id IN (SELECT, custid, FROM, custtoclass, WHERE, classid, IN, (, 1, 2, 3))

which obviously fails. So, a little help: is this IBO being too clever, or
me? If it's me, then I'd appreciate suggestions how to do it right.

Antti Kurenniemi