I have run into something like this myself. From what I have seen, if you change a column from NULL to NOT NULL and there is data in the table, you must give the column a default value to fill in. Then the update commands will force a rebuild of the entire table. The data will be copied to a temporary table. The original table will be deleted and then the modified table created in its place. After that, the data from the temporary table will be copied back into the updated table with the default value being added into the NOT NULL column, if there was no value present in the original data.
-----Original Message----- From: satz [mailto:[EMAIL PROTECTED] Sent: Thursday, October 04, 2007 9:56 AM To: [email protected] Subject: Re: DDL Utils... :) logically yes....But Even if theres a default value specified, the Code doesn't apply the same as it categorises this change to be different from ColumnRequiredChange and handles it differntly. Atlease it doesnt force the DefaultValueChange to be applied beforehand.. so still lookin for an answer!!! :( Jun Li-2 wrote: > > I think you have to define the default value in that case. Otherwise, you > will lost your data. > > On 10/4/07, callme_sanjay <[EMAIL PROTECTED]> wrote: >> >> >> Hello Team, >> >> when the table already has data how is the utility taking >> care of updating existing columns from NULL to NOT NULL... >> >> Please reply >> On Behalf of Satyam B. >> >> -- >> View this message in context: >> http://www.nabble.com/DDL-Utils...-tf4566113.html#a13033491 >> Sent from the Apache DdlUtils - User mailing list archive at Nabble.com. >> >> > > > -- > ------------ > Cheers, > Jun > > -- View this message in context: http://www.nabble.com/DDL-Utils...-tf4566113.html#a13040350 Sent from the Apache DdlUtils - User mailing list archive at Nabble.com.
