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

Home -> Community -> Usenet -> c.d.o.server -> Re: case short circuits?

Re: case short circuits?

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 20 Jun 2005 15:37:09 -0700
Message-ID: <1119307051.547332@yasure>


tq wrote:
> Question about this case statement below - is it actually evaluating
> the 3=3 or does it short ciruit? I'm trying to judge decode versus case
> in terms of potential performance differences.
>
> case when 1=2 and 3=3 then 0 else 1 end
>
> Thanks.

It is a good practice to always use parentheses to explicitly define your meaning.

case when (1=2 and 3=3) then 0 else 1 end

But in your case this is clearly impossible as your syntax is incorrect. No single value can ever be both a 1 and a 3.

Look up the correct syntax for the case statement at www.psoug.org click on Morgan's Library
click on CASE

or at http://tahiti.oracle.com

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Mon Jun 20 2005 - 17:37:09 CDT

Original text of this message

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