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: Rename a column in 7.3.4

Re: Rename a column in 7.3.4

From: Fraser McCallum <fmcc_at_NOSPAModbaguru.com>
Date: Wed, 17 Oct 2001 16:09:00 +0100
Message-ID: <i6hz7.1850$M15.18440@NewsReader>


Joel,

If you are able to have an outage on the database or at least that particular table (which I will now refer to as xyz) you can do the following:

export table xyz as a backup.
create the scripts to re-create indexes (you could use the export), triggers, grants, views etc on table xyz. create table xyz_bak as select * from xyz; drop table xyz;
create table xyz <standard table creation but with the new column name here>;
insert into table xyz (select col_a, col_b..... from xyz_bak; commit;
run the scripts you created earlier to remake indexes, triggers etc. Test!

With an insert statement only the number and type of columns have to match so it won't care that you have renamed a column in xyz as long as the order of the tables is still the same as xyz_bak.

Please note I have not given you the full SQL code just the outline of the procedure.

Kind Regards

Fraser McCallum
MVP Oracle
www.brainbench.com

"Joel Giraud" <joel.giraud_at_chu-bordeaux.fr> wrote in message news:9qjbtg$uf1$1_at_news.u-bordeaux.fr...
>
> I have to rename a column in an Oracle table in 7.3.4.
> Is it a way to do that without duplication ?
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Joel Giraud
> GIP Synapses 12, rue Dubernat
> 33404 Talence cedex France
> TEL: 05 56 79 87 05
> FAX: 05 56 79 53 95
> joel.giraud_at_chu-bordeaux.fr
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
>
Received on Wed Oct 17 2001 - 10:09:00 CDT

Original text of this message

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