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

  • From: "Lex de Haan" <lex.de.haan@xxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 28 May 2004 21:43:04 +0200

Hi Jared,

the difference becomes apparent if you try a condition like the following:

'Mort Subite' = NULL

This condition is neither TRUE nor FALSE; it evaluates to UNKNOWN.

According to three-valued logic, NOT UNKNOWN evaluates to UNKNOWN;
therefore, both statements will execute their ELSE branch;
so the first one executes statement 2, and the second one executes statement
1.

My math teacher (many moons ago) usually would say at this point: QED.

Kind regards,
Lex.

---------------------------------------------
visit my website at http://www.naturaljoin.nl
---------------------------------------------

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]On
Behalf Of Jared.Still@xxxxxxxxxxx
Sent: Friday, May 28, 2004 20:24
To: oracle-l@xxxxxxxxxxxxx
Subject: RE: Useful Oracle books - C.J. Date theory vs. practicality



> just for fun, check out these two commands:
>
> IF     (some condition) THEN (statement 1) ELSE (statement 2);
> IF NOT (some condition) THEN (statement 2) ELSE (statement 1);
>
> regardless the contents of your data structures,
> in COBOL these two are equivalent but in PL/SQL they are not!

You've really lost me here.

12:22:41 rsysdevdb.radisys.com - jkstill@dv01 SQL>
12:22:46 rsysdevdb.radisys.com - jkstill@dv01 SQL> l
  1  begin
  2
  3     if true then
  4             dbms_output.put_line('TRUE');
  5     else
  6             dbms_output.put_line('FALSE');
  7     end if;
  8
  9     if not true then
 10             dbms_output.put_line('FALSE');
 11     else
 12             dbms_output.put_line('TRUE');
 13     end if;
 14
 15* end;
12:22:47 rsysdevdb.radisys.com - jkstill@dv01 SQL> /
TRUE
TRUE

PL/SQL procedure successfully completed.

Maybe I need a slug of Ardberg to understand.

Jared
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

Other related posts: