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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL logical AND, OR, etc

Re: PL/SQL logical AND, OR, etc

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: 2 Feb 2004 21:32:17 -0800
Message-ID: <1a75df45.0402022132.50645112@posting.google.com>


stefan_at_dragolov.com (Stefan) wrote in message news:<89543c7c.0402021552.648515e3_at_posting.google.com>...
> How can I do a logical AND or OR of BOOLEAN variables in PL/SQL??
>
> Can I do this?
>
> var1 BOOLEAN:=FALSE
> var2 BOOLEAN:=TRUE
> var3 BOOLEAN
>
> var3:=var1 & var2 (so var3 would equal FALSE)
>
> ??

Exactly as you think. Why did you not simply tried it?

SQL> declare

  2     b1      boolean := false;
  3     b2      boolean := true;
  4     b3      boolean;
  5  begin
  6     b3 := (b1 or b2);
  7     if b3 then
  8             dbms_output.put_line('TRUE');
  9     else
 10             dbms_output.put_line('FALSE');
 11     end if;

 12* end;
SQL> /
TRUE PL/SQL procedure successfully completed.
--
Billy
Received on Mon Feb 02 2004 - 23:32:17 CST

Original text of this message

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