PR# 1226 WRONG default value for dates : EiffelStore handling of NULL values...

Problem Report Summary
Submitter: pgcrism
Category: EiffelStore
Priority: Medium
Date: 1999/11/04
Class: Feature Request
Severity: Serious
Number: 1226
Release: 4.4.004
Confidential: No
Status: Analyzed
Responsible:
Environment: Mozilla/4.05 [en] (WinNT; I)
Synopsis: WRONG default value for dates : EiffelStore handling of NULL values...

Description
EiffelStore chooses to give default values to data when retrieving NULL database values.
The translation table is as follows (excerpt from ODBC.README)

   Eiffel Data Type       Default Value if Database Field's Value is NULL
   ----------------       -----------------------------------------------
   INTEGER                    0
   REAL                       0.0
   DOUBLE                     0.0
   BOOLEAN                    false
   STRING                     ""(empty string)
   CHARACTER                  ' '(space)
   ABSOLUTE_DATE              1/1/1991 0:0:0(day/month/year h:m:s)

OUR PROBLEM :
We have to handle dates BEFORE 1/1/1991.  This date does not seem satisfying,
since we handle dates spanning the [19xx - 20xx] interval !

CHANGE REQUEST : 
Choose another default value.

PROPOSITION :
Let the opportunity to parameterize the "default value" behaviour.
For example, one could add the following features to DATABASE (for example. maybe it would be better in DB_SESSION).
* for each <type> in [integer, real, double, boolean, string, character, absolute_date]
  define one query and one command :

  default_<type>_for_null : <type>
    -- default <type> value when reading a NULL in database

  set_default_<type>_for_null ( v : <type>)
     -- set default value
     ensure
        default_<type>_for_null = v
     end

example : 
   default_integer_for_null : INTEGER
   set_default_integer_for_null (i : INTEGER) is
       ensure
          default_integer_for_null = i
       end

Best regards,

Paul G. Crismer
To Reproduce

										
Problem Report Interactions
From:pgcrism    Date:1999/11/04    Download   
State-Changed-From-To: open-analyzed
State-Changed-By: David_S
State-Changed-When: Thu Oct 14 15:16:09 PDT 1999
State-Changed-Why:
Dear Paul,

Sorry for this late answer and thank you for your report.
You can easyly choose an other value for the Date in the file ODBC.c.
However we will certainly include your implementation ideas in one following releases

Hope this helps.




State-Changed-From-To: analyzed-analyzed
State-Changed-By: EiffelStore_team
State-Changed-When: Thu Nov  4 18:36:56 PST 1999
State-Changed-Why:

Dear Paul,

We plan to do for next year a version of EiffelStore which will be able
to handle NULL values from a database. Storing them as Void reference
for objects or basic types default values for basic types. Until then
the suggestion given in one of our previous mail will certainly be
the best solution.

Hope this helps,