Subject RE: [firebird-support] Re: Conditional conundrum
Author Rick Debay
'U' is a one character value that may be contained in the column.
:param is a parameter in the stored procedure.

> Where
> (unit_use in ('U') and :param = 'U') or
> (unit_use not in ('U') and :param not ='U')

Is this legal for Firebird? In the stored procedure it would resolve to

(unit_use in ('U') and 'X' = 'U') or
(unit_use not in ('U') and 'X' not ='U')

If the parameter passed to the stored procedure was 'X'. From
experience and previous discussions, the planner has problems with
statements like this (the most discussed conditional that gives the
planner a fit is NULL IS NULL).

-----Original Message-----
[] On Behalf Of Ann W. Harrison
Sent: Thursday, October 20, 2005 3:04 PM
Subject: Re: [firebird-support] Re: Conditional conundrum

Rick Debay wrote:
> Select
> *
> From
> some_big_join
> Where
> (unit_use in ('U') and :param in ('U')) or
> (unit_use not in ('U') and :param not in ('U'))
> The portion of the query that tests a parameter against a value isn't
supported in Firebird.

Is 'U' shorthand for a long list of values? Is Param a field name? The
very simple

(unit_use in ('U') and :param = 'U') or
(unit_use not in ('U') and :param not ='U')

suggests itself if not. Alternately, you could use EXECUTE STATEMENT to
build up your query.



------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!


Visit and click the Resources item on
the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at


Yahoo! Groups Links