Subject Re: IBO sql parsing bug???
Author Svein Erling
Hi James,
write a program that display 100 lines with the following text:
"NULL is a state, not a value".

You seem to be using two parameters named :null and :null2. These will
never be NULL, my guess is that they are blank. Hence, every record
with a value will match "name starts with :null2", and the only
records that will be left out are the ones having NULL for the field
(since it is unknown, Firebird does not even infer (I think) that it
contains a value that all possible values contain ;o).

To test for NULL you have to use IS NULL or IS NOT NULL, there is no
way to use NULL as a parameter in the WHERE clause as if it was a
value.

Set

--- In IBObjects@yahoogroups.com, James <james_027@t...> wrote:
> Hi guys,
>
> I have this statement execute in ibexpert and the result was the one
> I expected when all parameters are null. But in IBO this statement
> fetches all the records from the table? Is this kind of statement
> not valid?
> Please advise thanks
>
> select *
> from customer
> where status != 'CAN' and (name containing :null or name starts with
> :null2)
>
>
> regards,
>
> james