Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Comparing numeric fields
Mon, May 24 2010 9:40 AMPermanent Link

Zdenek Vasku

Hello,

I have question about comparing numeric fields with null value. For
example:

SALARY<>0  returns rows with NULL values also

We use Oracle DB also and Oracle compare resutls with NULL are always
null (false). It's not problem in code. Programmers know what they are
do (sometimes Smile, but some filter are edited by end users and they
don't want to think about DB used.

Is there any plan to (for example) add setting to enable to change
this behaviour ic code?

Thanks
Zdenek
Tue, May 25 2010 5:39 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Zdenek,

<< I have question about comparing numeric fields with null value. For
example:

SALARY<>0  returns rows with NULL values also

We use Oracle DB also and Oracle compare resutls with NULL are always null
(false). It's not problem in code. Programmers know what they are
do (sometimes Smile, but some filter are edited by end users and they don't
want to think about DB used.

Is there any plan to (for example) add setting to enable to change this
behaviour ic code? >>

Unfortunately, no.  This is a "behavior" of DBISAM that is intrinsically
part of the core engine.

The workaround is to use:

SALARY <> 0 and SALARY IS NOT NULL

--
Tim Young
Elevate Software
www.elevatesoft.com
Wed, May 26 2010 4:20 AMPermanent Link

Zdenek Vasku

Tim Young [Elevate Software] wrote:

> Zdenek,
>
> << I have question about comparing numeric fields with null value.
> For example:
>
> SALARY<>0  returns rows with NULL values also
>
> We use Oracle DB also and Oracle compare resutls with NULL are always
> null (false). It's not problem in code. Programmers know what they
> are do (sometimes Smile, but some filter are edited by end users and
> they don't want to think about DB used.
>
> Is there any plan to (for example) add setting to enable to change
> this behaviour ic code? >>
>
> Unfortunately, no.  This is a "behavior" of DBISAM that is
> intrinsically part of the core engine.
>
> The workaround is to use:
>
> SALARY <> 0 and SALARY IS NOT NULL

Ok. Thanks. No problem, finally.

PS: I know the workaround, but end users uses same filter against
Oracle and DBISAM and it produces another results.

--
Wed, May 26 2010 8:22 AMPermanent Link

Robert Kaplan


"Zdenek Vasku" <z.vasku@ha-soft.cz> wrote in message
news:F16BBCE5-C703-4127-BE2A-6344E8C0FF47@news.elevatesoft.com...
>
> PS: I know the workaround, but end users uses same filter against
> Oracle and DBISAM and it produces another results.
>

Unless you have a specific reason for having null fields, make all amount
fields default to zero. Problem solved.

Robert

Image