Subject Re: ibotable filter problem
Author hundri_106
--- In IBObjects@y..., "Helen Borrie (TeamIBO)" <helebor@d...> wrote:
> At 01:08 PM 25-02-02 +0100, you wrote:
> >I'm trying to invoke a filter on a TIBOTable. The filter query in
question
> >is a compound statement somewhat similar to this:
> >
> >aTable.Filter:=(x >
Quantity_from_Supplier1+Quantity_from_Supplier2);
> >
> >When I try to do this, I get a "missing or extra" parenthesis. In
SQL I know
> >I can add this to the where clause and get the correct results so
I'm left
> >wondering if this is an ibo bug :-(
> >
> >Any suggestions anyone?
>
> Yes -
> 1. observe in the IB_Monitor what the statement is (you cannot
live for
> long in client/server without IB_Monitor). That might help to get
you
> familiar with what the parser is doing with the elements of the
statement.

ok...

>
> 2. Amend the filter clause so that the brackets actually do
something
> useful (like isolating the evaluation expression):
>
> aTable.Filter:= x >
(Quantity_from_Supplier1+Quantity_from_Supplier2);
>


Here are the (illogical IMHO) results:

1. Filter: order_quantity=(order_for_bookshop)
Monitor:
SELECT ALL TOORDER.*
FROM TOORDER
WHERE (order_quantity = ( AND order_for_bookshop ))
ORDER BY TOORDER.ID ASC

The adding by the parser of the "AND" is incorrect

2. Filter: order_quantity=order_for_bookshop
Results are correct for this one. But why should this be different
from the one above?

3. Filter: (order_for_bookshop)=order_quantity
Monitor: No output but this exception is thrown:
Invalid Syntax: extra or missing parenthesis:
(
(
order_for_bookshop ) =
order_quantity
)

Parser added an extra bracket here

4. Filter: (order_for_bookshop+order_for_clients)=order_quantity
Results are same as (3) above

5. Filter: order_for_bookshop+order_for_clients=order_quantity
Results: Correct interpretation.

6. Filter: order_for_bookshop + order_for_clients=order_quantity
(note the space near the "+" !)
Monitor: SELECT ALL TOORDER.*
FROM TOORDER
WHERE (order_for_bookshop+ order_for_clients = AND order_quantity)
ORDER BY TOORDER.ID ASC

Parser incorrectly added "AND"