Subject | Re: [IBO] Filter parser bugs |
---|---|
Author | Helen Borrie |
Post date | 2008-04-23T13:02:15Z |
At 10:13 PM 23/04/2008, you wrote:
'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!
'(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
>HiProblems with #1: a collate clause is not legal syntax in a search condition. That string should be
>
>#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'')'
> ^^^
'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!
>#2Could you try adding that pair of external parentheses yourself, to see how the parser handles them in each case? i.e.
>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.
'(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