Subject Re: [IBO] SQL errors when usin TIB_SearchPanel
Author Helen Borrie
At 09:16 PM 22/01/2007, you wrote:
>hello all,
>
>I'm testing latest beta 15 with BDS 2006. I'm making testing on
>TIB_SearchPanel using some advanced search strings and I have discovered the
>following:
>
>IN predicate:
>
> in(1, 5) works fine and returns rows
>
> in(1,5) works but doesn't return any row (notice the missing space after
>comma)
>
> in (1,5) or
> in (1, 5) give a strange behaviour:
>
>When search is performed the first time it gives this error:
>
> ISC ERROR MESSAGE:
> Dynamic SQL Error
> SQL error code = -104
> Token unknown - line 12, column 18
> in
> .
> STATEMENT:
> TIB_Query: "<TApplication>.MembersDM.MembersQuery"
>
>but the search executed other times gives only "No records found".

I can't comment on the discrepancy between the two IN() predicates
because in SQL they are exactly equivalent...so this looks like a parser error.

However, this example:

in (1,5) or
in (1, 5)

correctly produces an 'unknown token' exception from the error
vector, since it is not valid SQL.

If you want to have 2 in() tests, each has to be a full expression, viz.

where blah in(1,5)
or blah in(1, 5)

Apart from the fact that you are trying to test for a bug in IBO, it
is nonsensical. It wouldn't except for being nonsensical but it
would resolve to

where blah = 1 or blah = 5 or blah = 1 or blah = 5

(which might cause the optimizer to make a weird plan...something to
play with on a rainy Saturday...).

Helen