Re: ALTER TABLE DROP COLUMN ?
From: Rinse Bakker <Rinse=20Bakker%wavin#%forwarder_at_wavin.geis.com>
Date: 1996/01/30
Message-ID: <DLzKLw.795_at_inter.NL.net>#1/1
from EMP
/
DROP TABLE EMP
/
create table EMP as
select * from EMP_COPY
/ Received on Tue Jan 30 1996 - 00:00:00 CET
Date: 1996/01/30
Message-ID: <DLzKLw.795_at_inter.NL.net>#1/1
In article <4ei2pf$76j_at_maya.dei.unipd.it>, qwerty_at_chiara.dei.unipd.it (Luigi Scappin 264462/IL) says:
>
>Hi.
>I'm loking for an Oracle SQL statement to DROP a COLUMN in a database table.
>I think it's a stupid question... but I don't know how... :-)
>Thank's in advance.
>
> Luigi Scappin
>
> qwerty_at_lead.it
>
It is NOT possible to DROP a COLUMN in a database. The method I use is to copy all the columns except the one which is to be dropped to a copy-table Subsequently I drop the original table and recreate it from the copy-table.
Example: (drop column ENAME from table EMP):
create table EMP_COPY as
select empno
, job , mgr , hiredate , sal , comm , deptno
from EMP
/
DROP TABLE EMP
/
create table EMP as
select * from EMP_COPY
/ Received on Tue Jan 30 1996 - 00:00:00 CET