Subject | Re: [firebird-support] Order of operations - AND boolean operator |
---|---|
Author | Koenraad Lelong |
Post date | 2012-10-04T07:58:25Z |
On 03-10-12 22:30, Rick Debay wrote:
I could be way off, but is that query a litteral copy of your actual
query ? Is so, would enclosing your type-checks between brackets solve
your problem ?
Koenraad Lelong.
> The field f.ID is alphanumeric, it can contain many types of data andHi,
> the data type is described by f.ID_QUALIFIER .
> The problem is that Firebird is always evaluating "f.ID =" which throws
> an exception when f.ID contains non-numeric characters and b.ID_TYPE_*
> is numeric.
>
> FROM FOO f
> JOIN BAR b ON
> ((f.ID_QUALIFIER = 1) AND f.ID = b.ID_TYPE_1) OR
> ((f.ID_QUALIFIER = 2) AND f.ID = b.ID_TYPE_2
>
I could be way off, but is that query a litteral copy of your actual
query ? Is so, would enclosing your type-checks between brackets solve
your problem ?
> ((f.ID_QUALIFIER = 1) AND (f.ID = b.ID_TYPE_1)) ORRegards,
> ((f.ID_QUALIFIER = 2) AND (f.ID = b.ID_TYPE_2))
Koenraad Lelong.