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: James Petts <jpetts_at_celltech.co.uk>
Date: Tue, 20 Apr 1999 08:19:15 GMT
Message-ID: <371c3778.2153241998@right.celltech>


On Mon, 19 Apr 1999 14:54:29 -0500, Aaron Ogren <ogren_at_lucent.com> wrote:

>Actually, I don't want to use NVL because 1+NULL=3D1 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?

SQL*Server gets it wrong, then (surprise, surprise!). NULL represents an unknown value. When you add one to an unknown value that does not give a total of 1, it gives a slightly bigger unknown value. If you are relying on the behaviour of SQL*Server in this situation, then you are adding SQL*Server-specific code: is this more acceptable to you than adding Oracle-specific code? If so, please ignore this post. Otherwise, you will need to write some code to handle NULLs sensibly in SQL*Server.

James Petts Received on Tue Apr 20 1999 - 03:19:15 CDT

Original text of this message

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