Subject | RE: [firebird-support] Order of operations - AND boolean operator |
---|---|
Author | Rick Debay |
Post date | 2012-10-04T13:49:58Z |
I just tried it, and no it didn't work. I also added another set of
parenthesis around the qualifier test to try to make it evaluate sooner.
-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Koenraad Lelong
Sent: Thursday, October 04, 2012 3:58 AM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Order of operations - AND boolean
operator
parenthesis around the qualifier test to try to make it evaluate sooner.
-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Koenraad Lelong
Sent: Thursday, October 04, 2012 3:58 AM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Order of operations - AND boolean
operator
On 03-10-12 22:30, Rick Debay wrote:
> The field f.ID is alphanumeric, it can contain many types of data and
> 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
>
Hi,
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)) OR >
((f.ID_QUALIFIER = 2) AND (f.ID = b.ID_TYPE_2))
Regards,
Koenraad Lelong.
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Resources item on the
main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links