[Zope-DB] DCO2 and nulls again

Fredrik Svensson fredrik@ita.chalmers.se
Tue, 18 Dec 2001 17:34:34 +0100


Hi,

I want to do a follow-up on Darios earlier mail with some examples of our
random null behaviour.

We are experiencing problems with null values from several different
datatypes. Not just dates. Dates however is the most problematic since DCO2
tries to convert the date value to a Zope DateObject. When a DateObject is
created with random data it fails with an error that we cannot handle.

The version of DCO2 we are using was checked out of CVS on december the 4:th
and compiled on a RedHat 7.2 with Oracle client 8.1.7.1

However... Here is an example:
my_table(
 id number(9) not null,
 min_amount number(9),
 max_amount number(9)
)

I do a SELECT * FROM my_table WHERE min_amount IS NULL from toad or sqlplus
or something and get the following:
ID      MIN_AMOUNT     MAX_AMOUNT
2
4
6
22

ok... now I do a SELECT * FROM my_table in an ZSQL method from within zope
using DCO2. Looking at the result from testing that ZSQL method, this is
what I see:
ID     MIN_AMOUNT     MAX_AMOUNT
2
4
6       1077041684    1077041684
22     1077041684    1077041684

Another example was a complex sql query using several subselects. In that
case the null values where more random. We fixed that problem by using
NVL(subquery, 0) but that doesn't work with dates.

Anyone else who recognizes this behaviour??

/Fredrik