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 Souto <dbvision_at_optusnet.com.au>
Date: Sun, 30 May 2004 01:58:27 +1000
Message-ID: <40B8B323.50107@optusnet.com.au>


Hmmm, I'm having trouble posting from the notebook...

> From: "Lex de Haan" <lex.de.haan_at_naturaljoin.nl>  > no problem. that's the only thing it's supposed to do ;-)

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 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 applies only to PL/SQL "static" code. Things get of course unstuck for dynamic conditions. Although ANDs and ORs I can't quite see as making it necessarily more complex. The problem IME is the three-valued logic itself and how to handle it with two-value 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 syntax. I mean something like this:

(IF - or predicate) (nvl(<var>,'A') = 'something') (THEN yaddayadda)

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? Os is three-valued logic condemned to forever be the fly in the ointment (so to speak) of SQL?

-- 
Cheers
Nuno Souto
in sunny Sydney, Australia
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 - 10:55:20 CDT

Original text of this message

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