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

Home -> Community -> Usenet -> c.d.o.tools -> Re: How can I treat NULL-Values as Zero

Re: How can I treat NULL-Values as Zero

From: <sergey_s_at_my-deja.com>
Date: 2000/07/31
Message-ID: <8m4qke$h84$1@nnrp1.deja.com>#1/1

:new:field:=decode(:new.f1,null,0,:new.f1)+decode(:new.f2,null,0,:new.f2 )

The above statement substitutes 0 for null.

Sergey

In article <8m4mvu$4mo$11$1_at_news.t-online.com>,   "Nicolas Bronke" <newsgroup_at_trinity.de> wrote:
> Is it possible to define how Oracle treats Null-Values?
> My problem if I make e.g. a summarize in a trigger like
>
> :new:field:=:new.f1+:new.f2;
>
> The result will be NULL if either F1 or F2 is NULL.
>
> Sometimes I would prefer to receive ZERO. With two fields it is no
 problem
> for checking null-values but sometimes the formula is more complecate.
>
> Tjanks for any hint.
>
> regards
> Nicolas
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Jul 31 2000 - 00:00:00 CDT

Original text of this message

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