Subject Re: [IBO] Filter parser bugs
Author Helen Borrie
At 10:13 PM 23/04/2008, you wrote:
>Hi
>
>#1
>My query has sql:
> 'SELECT FIELD1, FIELD2, FIELD3 FROM TABLE'
>
>and filter:
> 'FIELD1 collate pxw_plk CONTAINING ''abc'''
>
>and it raises exception: 'token unkown AND'
>
>IB_monitor shows:
> 'SELECT FIELD1, FIELD2 FROM TABLE
> WHERE (FIELD1 collate pxw_plk AND CONTAINING ''abc'')'
> ^^^
Problems with #1: a collate clause is not legal syntax in a search condition. That string should be

'FIELD1 CONTAINING ''abc'''

If you need to force a collate order onto FIELD1, you might get away with using a CAST:
'CAST(FIELD1 AS VARCHAR(99) CHARACTER SET WIN1250 COLLATE PXW_PLK) CONTAINING ''abc'''
(substituting 99 for the declared length of FIELD1, of course!

>#2
>My query has sql as #1 above and filter:
> 'c(FIELD1)||c(FIELD2)||c(FIELD3) containing ''abc'''
>
>and it raises exception:
>'Invalid syntax: extra or missing parenthesis
>(
>c(kod) ||c (
>skrot ) ||c
>(
>nazwa ) containing
>'abc'
>)'
>
>amount of opening and closing parenthesis is equal. c() is udf from
>rfunc.dll. IBO 4.8.7.

Could you try adding that pair of external parentheses yourself, to see how the parser handles them in each case? i.e.

'(c(FIELD1)||c(FIELD2)||c(FIELD3) containing ''abc'')'

and also
'(c(FIELD1)||c(FIELD2)||c(FIELD3)) containing ''abc'''

BTW, I can see that expression causing problems at the server if any of those operands is nullable - although the IBO parser can't know that...

Helen