Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Useful Oracle books - C.J. Date theory vs. practicality
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.
-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org]On
Behalf Of Jared.Still_at_radisys.com
Sent: Friday, May 28, 2004 20:24
To: oracle-l_at_freelists.org
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_at_dv01 SQL>
12:22:46 rsysdevdb.radisys.com - jkstill_at_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;
Maybe I need a slug of Ardberg to understand.
Jared
-- 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 Fri May 28 2004 - 14:41:36 CDT
![]() |
![]() |