Re: Useful Oracle books - C.J. Date theory vs. practicality

  • From: "Nuno Pinto do Souto" <dbvision@xxxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Sat, 29 May 2004 22:54:16 +1000

----- Original Message ----- 
From: "Lex de Haan" <lex.de.haan@xxxxxxxxxxxxxx>

> no problem. that's the only thing it's supposed to do ;-) and it is purely
> two-valued.

Yeah, that's why I tried to use IS NULL to reduce what is at the start
a three-valued logic problem and bring it under the control of two-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...


Sure, but that was not the case of this workaround.  It is purely
reserved for PL/SQL "static" code.  Things get of course unstuck
for dynamic conditions.  Although ANDS and ORs I can't see as making
it necessarily more complex.  The problem IMHO is the three-valued logic
itself and how to handle it with two-valued SQL logic.

The NVL and NVL2 functions in Oracle help across the board - in
fact the workaround I mentioned can be re-coded using it - but it is
still a kludge.  Essentially, one ends up associating a particular
outcome of three-valued logic with a specific value in two-valued.
I mean something like this:


(IF - or predicate) (nvl(var,'A') = 'something') then etcetc
Ie, replace the outer IF by a given *known* value check that may (or
may not) match a subsequent comparison.


Always very hard to handle three-valued logic without some formal
construct or syntax that can cover all options.  Which brings me to
my next question, if you'd be so kind:

Is there an agreed syntax (or language) anywhere that can hold against
three-valued logic?  As in: commercially available?
Or is three-valued logic condemned to forever be the fly in the
ointment (so to speak) of SQL?

Cheers
Nuno Pinto do Souto
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 //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: