Subject | Re: [IBO] NULL in TIB_Query.Params |
---|---|
Author | Svein Erling Tysvær |
Post date | 2001-01-09T09:00:54Z |
Unfortunately, SQL doesn't work this way. There's no such thing as
'SELECT * FROM TEST WHERE A = NULL'. The only way to test is to specify
'SELECT * FROM TEST WHERE A IS NULL'.
I'm no expert on these things, so you may still hope Jason has made an IBO
way of solving this that I'm not aware of.
Set
At 09:51 09.01.2001 +0100, you wrote:
'SELECT * FROM TEST WHERE A = NULL'. The only way to test is to specify
'SELECT * FROM TEST WHERE A IS NULL'.
I'm no expert on these things, so you may still hope Jason has made an IBO
way of solving this that I'm not aware of.
Set
At 09:51 09.01.2001 +0100, you wrote:
>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
>
>
>
>