Re: column-type change
Posted in 1996
In article <3295A362.2F18@west.co.za>, "Mark D. Stock" <marks@west.co.za> writes >Thuc Nguyen wrote: >> >> How hard would it be to change a column from a char to a varchar? It >> would go from a char(20) to a varchar(20) >> No problem - one of my collegues did it at work. >> Is there a loss of the data if changed? >> No. >> I am on the informix engine 5.03 > >I haven't actually tried this, but there should be no loss of data. Quite >the opposite. Remember the 1 char overhead; VARCHAR(20) will require upto >21 chars. So if your CHAR(20) are mostly full, then you will be forcing >a large amount of data reorganisation. > >If it is a small table, I would recommend an unload/load with the MIN value >for the VARCHAR set to the average size or more of your CHAR fields data. > >Hope that helps, -- David Williams