Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Dropping columns in Oracle 7.3.4

Re: Dropping columns in Oracle 7.3.4

From: Claire Moore <claire.moore_at_capgemini.co.uk>
Date: Wed, 12 Jan 2000 08:46:43 +0000
Message-ID: <387C3F73.208@capgemini.co.uk>


The main problem is that the table that I need to change has a number of relationships with other tables & I need to know if I drop the constraints, re-create the table & then re-create the constraints that the integrity of the data won't be compromised.

kmidkiff wrote:
>
> This method has my vote.
>
> rungr_at_my-deja.com wrote:
>
> > In article <8EB8981Cdlm_at_206.141.192.241>,
> > dmausner_at_ameritech.x.net (dave mausner) wrote:
> > > claire.moore_at_capgemini.co.uk (Claire Moore) wrote in
> > > <387A174B.574_at_capgemini.co.uk>:
> > >
> > > >A while back I saw a message from someone advising of a utility they
> > > >knew that could allow you to drop columns from a table without
> > >
> > > don't know of a utility program as such.
> > >
> > > you could export your tables and specify "rows=no" so that all the
> > > constraints are exported without the rows; then do the create table as
> > > select, eliminating the bad columns; rename the tables so the good
> > table
> > > has the original table name; then reload the export file with
> > > "ignore=yes". imp should complain about the pre-existance of the
> > table,
> > > but should load the constraints.
> > > --
> > > dave mausner
> > >
> >
> > Dave;
> > Would the following sequence perform the same function?
> > create table temp as (select * from target_table);
> > drop table target_table cascade constraints; /*assumes no children*/
> > create table target_table (col1 varchar2(10), ... /*minus the column to
> > be dropped */) as (select col1, col2, ... from temp);
> > drop table temp;
> >
> > If so, how would you do it if the target_table has children?
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
> ---------------------------------------------------------------
>
> Name: kmidkiff.vcf
> Part 1.2 Type: text/x-vcard
> Encoding: 7bit
> Description: Card for kmidkiff
Received on Wed Jan 12 2000 - 02:46:43 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US