Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: adding 1 to NULL = 1?
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