From: CRISMER Paul-Georges To: bugs@berkeley.eiffel.com Cc: jacques@abstraction.ch Subject: RE: EiffelStore/2965 Date: Fri, 19 Oct 2001 09:48:40 +0200 Are you still alive ? > -----Original Message----- > From: bugs@berkeley.eiffel.com [SMTP:bugs@berkeley.eiffel.com] > Sent: mardi 9 octobre 2001 15:57 > To: paul-georges.crismer@groupes.be > Subject: EiffelStore/2965 > > Thank you very much for your problem report. > It has the internal identification `EiffelStore/2965'. > > If you want to add more information to your report or > reply to our answer, please reply to this message > without modifying the subject header. > > The individual assigned to look at your > report is: EiffelStore_team. > > >Category: EiffelStore > >Responsible: EiffelStore_team > >Synopsis: Numeric parameters whose values are zero are substituted > as NULL, which is wrong ! > >Arrival-Date: Tue Oct 9 06:57:00 PDT 2001 > >Severity: critical > >Priority: high > >Confidential: no > >Environment: > Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0) > > >Description: > The following query > > sql : STRING is "INSERT INTO TOTONUM VALUES (:an_int, :a_real, :a_double)" > > used this way > > my_int : INTEGER > my_real : REAL > my_double : DOUBLE > > ... > query : DB_CHANGE > > ... > my_int := 0 > my_real := 0.0 > my_double := 0.0 > > query.set_map_name (my_int, "an_int") > query.set_map_name (my_real, "a_real") > query.set_map_name (my_double, "a_double") > ... > query.modify (sql) > > > issues the following SQL : > > INSERT INTO TOTONUM VALUES (NULL, NULL, NULL) > > instead of > > INSERT INTO TOTONUM VALUES (0, 0.0, 0.0) > > *** THIS IS WRONG : database NULL values are not equal to ZERO *** > An RDBMS NULL value means "do not know". It's like a Void reference. > Zero means "we know the value and it's zero". > > This is not the same. > > Where to change ? > SQL_SCAN.get_value > > Please, revert to the 4.5 version of SQL_SCAN.get_value; the 5.0 is > completely wrong. > > Thank you. > > Paul-G. Crismer > > > > > >How-To-Repeat: > see above State-Changed-From-To: open-analyzed State-Changed-By: Manu State-Changed-When: Thu Oct 25 10:45:26 PDT 2001 State-Changed-Why: Dear Paul, I'm not sure that `get_value' is wrong. What has been done is that users have asked to be able to insert NULL in cases of basic types. As a consequence we have defined the notion of default value that will insert NULL instead of the actual value. If in your case 0 is not a default value, you have to change the default value in the class NUMERIC_NULL_VALUE.set_numeric_null_value. If you think that is completely wrong to do so, we will revised our implementation but do not forget that we need somehow to have the NULL value option. From: CRISMER Paul-Georges To: ISE Customer Support Cc: Subject: RE: EiffelStore/2965 Date: Fri, 26 Oct 2001 09:41:57 +0200 *** This has always been possible ! *** The parameters that have not been mapped are substituted by a NULL value. (for the implementation, see SQL_SCAN.replacement_string) So the way to insert NULL values is very simple : changer: DB_CHANGE ... -- clear all mappings changer.clear_all -- clear all mappings -- now map the non-NULL parameters changer.set_map_name (value, "parameter_name") ... -- execute the query ... In RDBMS world, zero and NULL are different values : zero is zero, NULL is "don't know". > -----Original Message----- > From: ISE Customer Support [SMTP:bugs@support.eiffel.com] > Sent: jeudi 25 octobre 2001 19:45 > To: paul-georges.crismer@groupes.be > Subject: EiffelStore/2965 > > Synopsis: Numeric parameters whose values are zero are substituted as > NULL, which is wrong ! > > State-Changed-From-To: open-analyzed > State-Changed-By: Manu > State-Changed-When: Thu Oct 25 10:45:26 PDT 2001 > State-Changed-Why: > > Dear Paul, > > I'm not sure that `get_value' is wrong. What has been done is that users > have asked to be able to insert NULL in cases of basic types. As a > consequence we have defined the notion of default value that will insert > NULL instead of the actual value. > > If in your case 0 is not a default value, you have to change the default > value in the class NUMERIC_NULL_VALUE.set_numeric_null_value. > > If you think that is completely wrong to do so, we will revised our > implementation but do not forget that we need somehow to have the NULL > value option. > > With best regards, > The Customer Support Team > > ------------------------------------------------------------- > Answer prepared by: Emmanuel Stapf > > ISE Building, 360 Storke Road, Goleta CA 93117 > 805-685-1006, fax 805-685-6869, > Customer support: http://support.eiffel.com > Product information: info@eiffel.com > > ------------------------------------------------------------- > To answer this message, use the `reply' button of your mail > tool without changing the `subject' header. > ------------------------------------------------------------- > > *** Check our Web page at http://www.eiffel.com > *** for important information: > > - Lots of practical tips and useful information. > > - New on-line manuals and technology papers.