RE: Useful Oracle books - C.J. Date theory vs. practicality
- From: "Lex de Haan" <lex.de.haan@xxxxxxxxxxxxxx>
- To: <oracle-l@xxxxxxxxxxxxx>
- Date: Sat, 29 May 2004 13:38:25 +0200
the "IS NULL" operator is a great operator to check for attributes for being
NULL,
no problem. that's the only thing it's supposed to do ;-) and it is purely
two-valued.
your suggestion is a nice "work around", and you could even write it more
condensed by using functions like COALESCE and CASE expressions to handle
the UNKNOWN case caused by null=values.
my only point (somewhere at the beginning of this thread :-) was that
certain seemingly obvious logical equivalences don't hold in three-valued
logic.
and I guess it is hard to make your workaround generic -- what if the
<condition> is constructed dynamically, at run time, and can e.g. be a
compound predicate with some ANDs and ORs?
then your "outer IF" becomes almost impossible to generate...
Cheers,
Lex.
---------------------------------------------
visit my website at http://www.naturaljoin.nl
---------------------------------------------
-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of Nuno Souto
Sent: Saturday, May 29, 2004 08:57
To: oracle-l@xxxxxxxxxxxxx
Subject: Re: Useful Oracle books - C.J. Date theory vs. practicality
Lex de Haan said,on my timestamp:29/05/2004 5:29 PM:
> the IS NULL operator is two-valued,
> so it would never show the "desired" behavior for this experiment...
> 'string' IS NULL always evaluates to FALSE, and '' IS NULL evaluates to
TRUE
> (which is quite unfortunate, but that's another discussion)
I see your point, of course. Otherwise it's harder to show the problem.
But the thing that bugs me is: isn't the Oracle (and presumably
others db) solution of "IS NULL" a good solution?
I mean: avoid the TRUE/FALSE/NULL logic problem without re-defining the
entire IF?
Is there something wrong with:
IF (<var> is NOT NULL) then
IF(<var> = 'something') then do_this
ELSE do_that
END IF;
ELSE do_nothing;
END IF;
other than the obvious verbosity/style of writing?
(says he who had to code something like this ad-infinitum in a
project 3 years ago...)
--
Cheers
Nuno Souto
in sunny Sydney, Australia
dbvision@xxxxxxxxxxxxxxx
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to: oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
BEGIN:VCARD
VERSION:2.1
N:de Haan;Lex
FN:Lex de Haan
ORG:Natural Join B.V.
TEL;WORK;VOICE:+31.30.2515022
TEL;HOME;VOICE:+31.30.2518795
TEL;CELL;VOICE:+31.62.2955714
TEL;WORK;FAX:+31.30.2523366
ADR;WORK:;;Pieter Breughelstraat 10;Utrecht;;3583 SK;Netherlands
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Pieter Breughelstraat 10=0D=0AUtrecht 3583
SK=0D=0ANetherlands
URL;WORK:http://www.naturaljoin.nl
EMAIL;PREF;INTERNET:lex.de.haan@xxxxxxxxxxxxxx
REV:20040224T160439Z
END:VCARD
- Follow-Ups:
- Re: Useful Oracle books - C.J. Date theory vs. practicality
- From: Nuno Pinto do Souto
- Re: Useful Oracle books - C.J. Date theory vs. practicality
- From: Binley Lim
- References:
- Re: Useful Oracle books - C.J. Date theory vs. practicality
- From: Nuno Souto
Other related posts:
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » RE: Useful Oracle books - C.J. Date theory vs. practicality
- » Re: Useful Oracle books - C.J. Date theory vs. practicality
- Re: Useful Oracle books - C.J. Date theory vs. practicality
- From: Nuno Pinto do Souto
- Re: Useful Oracle books - C.J. Date theory vs. practicality
- From: Binley Lim
- Re: Useful Oracle books - C.J. Date theory vs. practicality
- From: Nuno Souto