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: adding 1 to NULL = 1?

Re: adding 1 to NULL = 1?

From: Michael Rothwell <michael_rothwell_at_non-hp-usa-om46.om.hp.com>
Date: Tue, 20 Apr 1999 10:23:06 -0700
Message-ID: <371CB7FA.BD23A58A@non-hp-usa-om46.om.hp.com>


Aaron Ogren wrote:
>
> Hans Nesbø wrote:
> >
> > Use NVL - NULL-Value Substitute.
> > The format is:
> > NVL(value, substitute)
> > If value is NULL, this function is equal to substitute
>
> Actually, I don't want to use NVL because 1+NULL=1 works
> under SQL*Server; SQL*Server does not know NVL and I
> don't want to add Oracle-specific code...Are there any
> other methods?
>
> Thanks,
> Aaron
>

Put a trigger on the table that replaces NULLs with a 0. Then it will work fine for the addition, but may change some query results because the field is now 0 and not NULL.

Michael.
--
Michael A. Rothwell
Oracle DBA/Oracle Web Applications Developer

Views expressed here are not those of my company No - Actually - Since I am independent, They are the views of my company. Received on Tue Apr 20 1999 - 12:23:06 CDT

Original text of this message

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