Page 1 of 1

Null values on table testprojects column prefix

Posted: Thu Sep 20, 2012 6:42 am
by itamare
Hi to all,
I get a strange situation, on table testprojects column prefix which should be not nullable, I have null values. I think they have came from old version of the application which upgraded with the time. I order to merge two DB, I had need to convert this column to nullable so I can insert into it the rows with the null values. Obviously, after my changes I can't convert it back.
I wonder if this change can affect the activity of the DB and the application?

Thanks in advance

Re: Null values on table testprojects column prefix

Posted: Thu Sep 20, 2012 10:12 pm
by fman
yes, you have to fix this manually

Re: Null values on table testprojects column prefix

Posted: Sun Sep 23, 2012 7:47 am
by itamare
Sorry but I don't understand your answer, I did change the column configuration manually but I asked about the consequences of those change. Do anybody know?

Re: Null values on table testprojects column prefix

Posted: Sun Sep 23, 2012 8:41 am
by StephenP
In any database-based application, if a column has been defined to be non-nullable, but you make it nullable and introduce null values, then you should expect things to break somewhere. But the programmers may not be able to tell you exactly what will break and when - the column was defined non-nullable precisely so they could avoid worrying about that.

So you have to fix it. In other words: insert unique values for all rows which are currently null and set the column back to non-nullable.

Hope this helps.