Subject | Re: [firebird-support] Problem with query parameter |
---|---|
Author | Harriv |
Post date | 2009-03-10T15:14:49Z |
On Tue, Mar 10, 2009 at 5:05 PM, <Alan.Davies@...> wrote:
only filtered records when the parameter is not null. FIELD is never
null.
I'm trying to avoid dynamic dynamic or almost-duplicate query in the
application code.
>Basically I'd like to get all records when the parameter is null, and
> No it isn't possible, which is what the error is telling you.
> You can't select anything from a table based on a parameter you are
> setting if that parameter is null. What do you expect back??
> If you want a set of records where their value is null, then "select *
> from atable where afield is null" will work.
> hth
only filtered records when the parameter is not null. FIELD is never
null.
I'm trying to avoid dynamic dynamic or almost-duplicate query in the
application code.
>
> --
> Alan J Davies
> Aldis
>
> Quoting Harriv <harriv@...>:
>
> > I'm trying to do something like this:
> >
> > select * from TABLE
> > where FIELD = :param or :param is null
> >
> > When executing that, I get "Dynamic SQL Error SQL error code = -804 Data
> > type unknown" error. Should the above statement even be a possible?
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
>
>