I think this behavior is correct. If you alter a table and set the default for an integer to 0 all existing null values in this column will be set to null and that is what you are aiming.
My question to you is why setting the value to null instead of 0. In that case you are sure the column value is set manually to 0. Tony From: [email protected] [mailto:[email protected]] On Behalf Of Dennis McGrath Sent: dinsdag 9 november 2010 18:26 To: RBASE-L Mailing List Subject: [RBASE-L] - RE: Expected behavior OR bug? My coworker, Lena, informs me that this behavior also exists in SQL Server. It is imperative that defaulted columns be NOT NULL so that structure changes do not introduce garbage data. Dennis McGrath _____ From: [email protected] [mailto:[email protected]] On Behalf Of Dennis McGrath Sent: Tuesday, November 09, 2010 11:10 AM To: RBASE-L Mailing List Subject: [RBASE-L] - RE: Expected behavior OR bug? Sami, I tested this in 7.6 DOS The same thing happens. It is certainly not what I would have expected, since I assumed 'default' would get applied only to new rows. In any case, given this behavior, I would certainly recommend that any columns with a default should also be NOT NULL. Dennis _____ From: [email protected] [mailto:[email protected]] On Behalf Of Sami Aaron Sent: Tuesday, November 09, 2010 10:47 AM To: RBASE-L Mailing List Subject: [RBASE-L] - Expected behavior OR bug? I just had something occur that I don't remember seeing before and I wasn't sure if it was expected behavior or a bug that I should report. I noticed it in a V-8 database first and then tested it in 9.0 and it's the same. Start with a table with a currency column that has a default value of $100 in the field. Update some records in the table to change the value to a different number than $100 and also to change some to NULL. Then issue an ALTER TABLE ALTER SomeOtherColumn changing the width of a text field. What happens is that in the currency column, any records that had the original $100 changed to a different number retained the changed value - so that was correct. BUT any records that had a NULL value in the column now have the $100 there. What do you guys think? Thanks, Sami ____________________________ Sami Aaron Software Management Specialists 913-915-1971 [email protected] P Please consider the environment before printing this e-mail

