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 expression

Re: CASE expression

From: Robert Klemme <shortcutter_at_googlemail.com>
Date: Wed, 06 Dec 2006 11:30:54 +0100
Message-ID: <4tnkeoF14eh3uU2@mid.individual.net>


On 06.12.2006 02:19, April wrote:
> As part of a somewhat simple SELECT statement, I am attempting the case
> expression below on an Oracle server and am getting an Oracle error
> stating "Error signaled in parallel query server. Invalid number".
> Here's the expression:
>
> CASE
> WHEN VARIABLE_A = 'R' THEN 0
> WHEN VARIABLE_A = 'C' THEN
> NVL(NUMBER_1,0)+NVL(NUMBER_2,0)
> END AS TOTAL
>
>
> The idea is I only want to sum numbers 1 and 2 when variable A = 'C'.
> If its 'R' then I want TOTAL to be 0. Am I missing something?

You are missing the ELSE branch. That might be the cause.

        robert Received on Wed Dec 06 2006 - 04:30:54 CST

Original text of this message

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