Re: Can we change the column width of a column in a live database?
Posted in 1998
Jonathan Leffler wrote:
>
> On Thu, 24 Sep 1998, Saleem Mohammad wrote:
> > Can we change the ( I have to increase the width of character
> > filed in a table of a live database) width of a column in a
> > live database??? Please let me know.
>
> Yes:
>
> ALTER TABLE WhichEver MODIFY (ColName CHAR(128) NOT NULL);>
> It will temporarily lock the table, of course. You'd also want to check
> whether the alter will be done 'in place' or whether you'll need enough
> space to duplicate the table with the new size, but the database system as
> a whole does not have to go offline to do this. Also, if you have I4GL
> programs, you'll probably need to recompile them with the revised schema.
> And with D4GL programs, you'll need to regenerate the dbase.sch file before
> doing the recompilation.
>
> Yours,
> Jonathan Leffler (jleffler@informix.com) #include <witticism.h>
> Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN
> Informix IDN for D4GL & Linux -- http://www.informix.com/idn
Just to clarify what Jonathan wrote about 4GL programs: they will work
perfectly well with the wider char column but will still use the
original width. You will probably *want* to recompile them to actually
use the extra width. This would also apply to Informix-SQL Perform
screens and Ace reports.
These programs get their information about column widths at compile
time, hence the need for recompiling. The same would probably apply to
other 3rd party tools.
--
Peter Lancashire
Information Systems Specialist, Bayer plc
Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK
Tel: +44-1635-562258, Fax: +44-1635-562281
---
If all else fails, read the instructions AND the release notes.
All opinions are my own and not those of Bayer plc.
My Internet plumbing does not allow me to mail and post news together.
Sorry.
---
Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/