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: changing the Seqence of the Columns in a Table

Re: changing the Seqence of the Columns in a Table

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Wed, 13 Mar 2002 13:55:57 +0300
Message-ID: <a6nb50$bbu$1@babylon.agtel.net>


I believe this is not possible directly. The only was I could think of is to create new_table as select <columns in new order> from old_table and then rename old_table to old_table_backup and rename new_table to old_table (you will also need to create indexes on the new_table anew AFTER you renamed old and new tables). After you verify that everything is ok, you can drop the backup of the old table to free the space taken by it and do an alter tablespace coalesce (just in case). As side effect your table and indexes will be reorganized.

Actually I don't see why you would want to reorder the columns because you can always select them in any particular order, the only case when they will be returned in order they are specified at table creation is when you select *.

-- 
Vladimir Zakharychev (bob@dpsp-yes.com)                http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.


"Sascha Kern" <Teddy_71_at_freenet.de> wrote in message news:a6n4m5$i5c$00$1_at_news.t-online.com...

> Is ist possible to change te Sequence of columns in a table.
> How can this be done.
> Thanks for helping me
>
>
Received on Wed Mar 13 2002 - 04:55:57 CST

Original text of this message

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