Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL logical AND, OR, etc
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;
-- BillyReceived on Mon Feb 02 2004 - 23:32:17 CST