Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> 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 <dbvision_at_optusnet.com.au>
Date: Sat, 29 May 2004 22:54:16 +1000
Message-ID: <002c01c4457c$337b5b00$6600a8c0@DCS005>

> 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_at_optusnet.com.au



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org 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
-----------------------------------------------------------------
Received on Sat May 29 2004 - 07:52:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US