Subject Re: [IBO] NULL in TIB_Query.Params
Author Nando Dessena
Jason,

> > >True, it could be useful - but I think Jason would have to change the SQL
> > >to make this work (since = is not the same as IS), hence the need to
> > >reprepare. Jason, does TIBOQuery emulate TQuery in this case (or does
> > >TIBQuery behave like TIBOQuery and differ from TQuery)?
>
> I don't really know here. I'll have to examine things.

The BDE TQuery works exactly the same way, which is the only reasonable
thing to do, in my opinion.

> For the sake of input parameters I think it should treat a NULL value in an
> input parameter to the equivalent as the IS NULL in the SQL syntax.
> Otherwise it becomes rather difficult to maintain a single prepared
> statement for efficient interaction with the server.
>
> I don't want to see the syntax WHERE ACOL = NULL
>
> 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?

I believe that would encourage to treat NULL as a value instead of a
state.
If one has to test for null as a value, then maybe his database design
has a flaw.
Starting to change the SQL text by changing parameter values could be a
dangerous trend, in my view. Would you also change 'WHERE ACOL <> :A'
into 'WHERE ACOL IS NOT NULL'? What about 'WHERE ACOL >= :A'?
--
____
_/\/ando