Subject | Re: [IBO] NULL in TIB_Query.Params |
---|---|
Author | Jason Wharton |
Post date | 2001-01-09T17:13:06Z |
No, there is no workaround built into IBO to get around this SQL deficiency.
The only thing I would be able to do is detect it and then reprepare a
statement with the appropriate SQL syntax.
Fortunately when you are executing parameters in an INSERT or UPDATE
statement for column values it will accept the NULL. But, when working with
the WHERE clause it doesn't work as it should.
It could also have to do with the IsNullable setting of the parameter. What
does the IsNullable property have to say about it?
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
The only thing I would be able to do is detect it and then reprepare a
statement with the appropriate SQL syntax.
Fortunately when you are executing parameters in an INSERT or UPDATE
statement for column values it will accept the NULL. But, when working with
the WHERE clause it doesn't work as it should.
It could also have to do with the IsNullable setting of the parameter. What
does the IsNullable property have to say about it?
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
----- Original Message -----
From: "Svein Erling Tysvær" <svein.erling.tysvaer@...>
To: <IBObjects@egroups.com>
Sent: Tuesday, January 09, 2001 2:00 AM
Subject: Re: [IBO] NULL in TIB_Query.Params
> 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:
> >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
> >
> >
> >
> >
>
>
>