Re: Re^2: How to delete a column?
Date: 1995/12/05
Message-ID: <james.lawrence.129.0010080A_at_epamail.epa.gov>#1/1
In article <MSGID_2=3A240=2F5840.3=40fidonet_be98e9ff_at_fidonet.org> Karl_Regel_at_p3.f5840.n240.z2.fidonet.org (Karl Regel) writes:
>From: Karl_Regel_at_p3.f5840.n240.z2.fidonet.org (Karl Regel)
>Subject: Re^2: How to delete a column?
>Date: Mon, 20 Nov 1995 19:45:00 +0000
>+++ jim.gregory # DaytonOH.attgis.com_at_2:240/5889
>+++ "Re: How to delete a column?"
>jg>
>jg> e.g. create table b
>jg> <column list>
>jg> as select <columns > from table a;
>jg>
>jg> This will create your table ( less the column ) and load it from the old
>jg> table. Then drop table a and rename table b to table a.
>But you'll be even more in trouble, if foreign key-constraints are engaged
>to keep your DB-design clean !
>The VERY last solution is to save as much diskspace as possible and leave
>the column in the table :
>1: update table a set col_to_delete = NULL; COMMIT;
>2: alter table a modify ( col_to_delete varchar2(1));
>And now, it nearly needs no more diskspace, while it's still existing.
Actually varchar2 columns are stored as variable length. If the column is null changing the length doesn't do anything to save space.
Lawrence.......
>Regards Karl
>FIDO : 2:240/5840.3
>MAIL : 100666.3450_at_compuserve.com
Received on Tue Dec 05 1995 - 00:00:00 CET