Subject Re: [IBO] NULL in TIB_Query.Params
Author Joseph Alba
A work around is to use the SQLWhereItems and the OnPrepareSQL event instead of
Parameters:

Place the desired parameters as fields to the Datamodule object.

type
datamod=class(TDatamodule)
....
public
APRM: String;
end;


OnPrepareSQL:
with Query do
begin
if APRM='' then
SQLWhereItems('ACOL IS NULL')
else
SQLWhereItems('ACOL='+QuotedStr(APRM)
end;

---
Have you tried using the IsNull property of parameter instead?

Joseph Alba
jalba@...


Ondrej Kelle wrote:

> Hello Jason,
>
> > but in the case where you have an input parameter:
> >
> > WHERE ACOL = :APRM
> >
> > And in code someone puts:
> >
> > ParamByName( 'APRM' ).Clear;
> >
> > I want the server to treat that like
> >
> > WHERE ACOL IS NULL
> >
> > Does this make sense?
>
> Yes, that's exactly what I was trying to suggest.
>
> But before you start working on this feature in IBO, I have to correct my
> previous statement about BDE TQuery support of this:
> Out of curiosity, I've just spent some time playing around with TQuery and
> TParam and I have to give up and conclude that it doesn't work there, either
> - unless I've missed something important :-\ Anybody interested, please go
> ahead and try for yourself.
> I'm sure I have used TParam.Clear to specify NULL in the past but I guess it
> was an INSERT or an UPDATE statement, not SELECT. Sorry if I've caused any
> confusion.
>
> Anyway, if IBO does support this, it will be just cool.
>
> Good luck,
> TOndrej