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: ORA-00907

Re: ORA-00907

From: Ray Teale <ray_at_BLAHholly.com.au>
Date: Tue, 2 Apr 2002 11:25:21 +1000
Message-ID: <4M7q8.985$l%4.96939@ozemail.com.au>


This is not how decode works.

The first arguement is an expression which must return a value. The second argument is the search value
The third is the returned result if expression=search value. More search, result pairs can be added in following arguements. The final arguement is the returned result if no search values match the expression result.

Therefore Decode evaluates the first argument, compares the result with the second to return the third if true or the fourth if false.

What you need to do is :

decode(A,0,C,B/A)

regards

Ray

"James O'Brian" <jb300000456666_at_yahoo.com> wrote in message news:a8ag3n$71e$1_at_slb2.atl.mindspring.net...
> Try to do:
> if A not equal to zero, then divide B by A, else C.
>
> decode(A<>0,B/A,C)
>
> But gives:
>
> decode(A<>0,B/A,C)
> *
> ORA-00907: SQL missing right parenthesis
>
> Your time will be appreciated. Thanks.
>
>
Received on Mon Apr 01 2002 - 19:25:21 CST

Original text of this message

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