Subject | Re: [IBO] NULL in TIB_Query.Params |
---|---|
Author | Jason Wharton |
Post date | 2001-01-20T07:21:51Z |
I believe that this is actually a feature. IF the following were true then
we would have a match:
NULL = NULL
but, as SQL has it, this isn't true.
It is necessary to alter the SQL of the statement to use the IS NULL
operator.
Sorry, but this one is just going to have to stay this way.
One thing I could do is make that substitution for you I suppose.
How many would be interested in such a feature?
Thanks,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
we would have a match:
NULL = NULL
but, as SQL has it, this isn't true.
It is necessary to alter the SQL of the statement to use the IS NULL
operator.
Sorry, but this one is just going to have to stay this way.
One thing I could do is make that substitution for you I suppose.
How many would be interested in such a feature?
Thanks,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
----- Original Message -----
From: "Ondrej Kelle" <O.Kelle@...>
To: <IBObjects@egroups.com>
Sent: Tuesday, January 09, 2001 1:51 AM
Subject: [IBO] NULL in TIB_Query.Params
> Hi all,
>
> my question today is how to specify NULL in TIB_Query.Params? I tried
> calling Params[xx].Clear, Params.ClearBuffers(rsNone), assigning Null or
> Unassigned to Params[xx].Value but none of these works. Please consider
the
> following test case:
>
> CREATE TABLE TEST (
> A INTEGER,
> B INTEGER
> );
>
> the test table contains the following data:
>
> A B
> ============ ============
>
> <null> 1
> <null> 2
> 1 1
> 1 2
> 2 1
> 2 2
>
> I would like to use TIB_Query with a parameter. SQL.Text property contains
> statement 'SELECT * FROM TEST WHERE (A = :A)'.
>
> with IB_Query1 do
> begin
> Close;
> if not Prepared then
> Prepare;
> Params[0].Clear;
> // Params.ClearBuffers(rsNone);
> // Params[0].Value := Null;
> // Params[0].Value := Unassigned;
> Open;
> // here I always get Eof
> end;
>
> Thanks in advance for your help
> TOndrej
>
>
>