Subject | RE: [IBO] NULL in TIB_Query.Params |
---|---|
Author | Claudio Valderrama C. |
Post date | 2001-01-11T04:06:20Z |
In this case, two solutions exist at least:
- Create two views, one of them gets called only when you want to test for
NULL.
- Create a selectable procedure that tests for the input parameter being
NULL and takes appropriate actions in this case.
I would be frightened if IB would allow the
where field = :param
expression to succeed with NULL in either side.
C.
- Create two views, one of them gets called only when you want to test for
NULL.
- Create a selectable procedure that tests for the input parameter being
NULL and takes appropriate actions in this case.
I would be frightened if IB would allow the
where field = :param
expression to succeed with NULL in either side.
C.
> -----Original Message-----
> From: Ondrej Kelle [mailto:O.Kelle@...]
> Sent: Martes 9 de Enero de 2001 4:52
> To: IBObjects@egroups.com
> 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
>
>
>
>