[Zope] ZOracleDA-beta5 problem; possible bug running NT
Zac Stevens
burritob@.cryptocracy.com
Wed, 5 Sep 2001 12:51:35 +1000
On Tue, Sep 04, 2001 at 04:42:32PM +0100, J. Cone wrote:
> I don't know about other databases, but you can get the result you want in
> Oracle with the nvl function, by selecting
>
> nvl(optional_number, 0)
>
> from the database. If you couldn't control the replacement value and 0 had
> an exisiting meaning, I would think that disastrous.
Which the OP did :)
That was his other point, which no-one else has addressed. He noted that
when using the above function that although the desired '0' was being
returned, all numbers were now floats - ie, '0.0' instead of '0'.
That's purely as a result of the Python type that the column is cast into.
It would seem that the NVL function changes that from an int to a float in
that case.
Again, a pain to deal with but entirely logical nonetheless.
-Z