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: How to Insert a Column between existing columns?

Re: How to Insert a Column between existing columns?

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Tue, 9 Jan 2007 06:43:56 +0100
Message-ID: <45a32b9b$0$3810$426a74cc@news.free.fr>

"sealo" <seahalo_at_gmail.com> a ¨¦crit dans le message de news: 1168312784.295902.287170_at_38g2000cwa.googlegroups.com...
| Hello,
| I want to insert a new column in the specified position to a exsited
| table. But all the default operation of adding column is to append the
| new column at the tail.
|
| There seems no SQL statement for my purpose.
|
| For example:
| The existing table have columns
| ID NUMBER(10)
| AGE NUMBER(10)
|
| I want to insert a new column NAME (VARCHAR2 (30)) between ID and AGE.
| Then, the expectation should like this.
|
| ID NUMBER(10)
| NAME VARCHAR2 (30)
| AGE NUMBER(10)
|
|
| Is there some method for this ?
|

1/ Column order is meaningless in relational model
2/ It should be useless as you should always name the columns in your statements
3/ If you really want to do that, use dbms_redefinition

For instance:
http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_redefi.htm#sthref5656 http://www.psoug.org/reference/dbms_redefinition.html

Regards
Michel Cadot Received on Mon Jan 08 2007 - 23:43:56 CST

Original text of this message

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