Re: EASY? Drop a column in a table.

From: Michael Nolan <nolan_at_helios.unl.edu>
Date: 24 Jun 1994 23:30:04 GMT
Message-ID: <2ufq9s$96i_at_crcnis1.unl.edu>


aarhemtu_at_cayley.uwaterloo.ca (Anil) writes:

>I'm somewhat new at this. I tried to drop the column APPL_ID in
>a table called PERSON in Oracle 7. I tried:

There is no easy way to drop or rename a column in Oracle 7.

About the only safe way to do it is to rename the table and recreate it, repopulating it from the renamed table.
(CREATE TABLE XXXX AS SELECT ...... FROM OLD_XXXX ....) This assumes that you can afford the disk space involved (including rollback space), and can be a lot of work if there are a lot of indexes, constraints, and triggers for the table.

You might consider renaming the table and creating a view (using the old table name) which doesn't include that column. There may be a small performance penalty for this, but if so it isn't noticeable on my system.

One strategy of table management is to have ALL tables which will be accessed by persons other than their creator treated this way, because it is a whole lot easier to redefine a view. (CREATE OR REPLACE VIEW ...)

---
Michael Nolan, Sysop for the DBMS RoundTable on GEnie
nolan_at_notes.tssi.com, dbms_at_genie.geis.com
(posted from nolan_at_helios.unl.edu)
Received on Sat Jun 25 1994 - 01:30:04 CEST

Original text of this message