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

Home -> Community -> Usenet -> c.d.o.misc -> Re: how to alter table columns:

Re: how to alter table columns:

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Wed, 11 Aug 1999 16:29:04 +0100
Message-ID: <934385698.3733.1.nnrp-04.9e984b29@news.demon.co.uk>

  1. Best strategy - rename the table, create view cmpd as select renamed column list from renamed table

    Alternative:

        create new_table unrecoverable as select renamed column list from cmpd

        rename cmpd to backup_cmpd
        rename new_table to cmpd

    Oracle 8i option:
        alter table cmpd add column .....
        update cmpd set new_column = old_column
        alter table cmpd drop column ....


2: Alter table cmpd drop primary key;

--

Jonathan Lewis
Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk

Zahid Khan wrote in message <37B05ED7.116B8E84_at_cc.gatech.edu>...
>1.] I have a table declared as :
>
>create table cmpd (
>cmpd_formula varchar2(20),
>ca_number varchar2(10));
>
>But now I want to change the name of the field ca_number to ca_no How do
>I do this?
>
>2.] I have the cmpd_formula field declared as a primary key. But now
>I've decided that I don't want it to be the primary key. How do I make
>this change?
>
>TIA
>--zahid
>
Received on Wed Aug 11 1999 - 10:29:04 CDT

Original text of this message

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