Setting date fields to nullable

Steve Albin steve at steve-albin.com
Sun Aug 23 14:22:00 CDT 2009


Yes, I agree, but I stated my case incorrectly.  I had some 
records that had a date of 1/1/1990 for instance.  Those records 
had a date of NULL after I set the field to nullable.

I think this may be a bug, but I can't reproduce the problem 
with a small project.  It is only happening for this one user 
database and maybe he corrupted his file in some unique way.  
And again, I may be doing things incorrectly.

At any rate, I changed my process to save the dates in a 
temporary field, then set the original date field to nullable 
and then reload the dates back in after that.  Now all is well.

Steve

--
Steve Albin - Montclair, NJ  - USA
http://www.jazzdiscography.com/
http://www.steve-albin.com/






On 8/23/09 at 2:01 PM, ruslan_zasukhin at valentina-db.com (Ruslan 
Zasukhin) wrote:

>On 8/23/09 7:57 PM, "Steve Albin" <steve at steve-albin.com> wrote:
>
>Hi Steve,
>
>Lets clarify.
>
>Let you have Table with 100 records.
>
>Now you make some field FLD to be Nullable.
>You do this and ...
>
>MY expectation is tat all 100 records contain NOT NULL values.
>For any type of field (may be except BLOB)
>
>ZERO (0) value is not NULL, so its wrong expectation that ZEROs should
>become NULLs.
>
>
>>I have a data field that is not set to nullable.  I am writing a
>>conversion for this database to change the schema so the field
>>will be nullable using the following code:
>>
>>
>>newDateFld = VDate(BaseObject.Field("dIssueDate"))
>>newDateFld.IsNullable = True
>>
>>After doing this, the schema is set correctly, but several of
>>the legitimate dates are set to null also.  I would expect the
>>dates stored as 00/00/0000 to be set to null but not legitimate
>>dates such as 1/1/1990.
>>
>>Is it legal to set a field to nullable this way after it has
>>already been loaded with data?
>>
>>Should I unload the field to a file and reload it before and
>>after changing the schema?
>



More information about the Valentina mailing list