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: add a new column into the middle of an existing table

Re: add a new column into the middle of an existing table

From: Howard J. Rogers <dba_at_hjrdba.com>
Date: Wed, 1 May 2002 09:32:01 +1000
Message-ID: <pSFz8.34$su6.236@news.oracle.com>


Not in 8i.

However:

  1. why is column order particularly important? For LONGs and LONG RAWs, it could be, but for pretty much everything else, it's irrelevant.
  2. You can always add your column onto the end of the table as you've described, and then create a view on that table. When you create the view, you get to select the columns, and the order in which they are displayed, regardless of what is actually stored in the underlying table.
  3. In 9i, there is a dbms_redefinition package which allows you to do exactly what you are (plus more, of course!). So if it is absolutely essential that you stick this new column in the middle of the original table, perhaps an upgrade is in order?

Regards
HJR PS. Don't crosspost.

"lei wang" <leiwang_q_at_hotmail.com> wrote in message news:af074b9c.0204301247.65da02f9_at_posting.google.com...
> Is there an easy way to add a new column into the middle of an
> existing table? Seems to me that you have to create a new table and
> copies data from the old table. <Alter table add column> statement
> will only adds columns at the end of an existing table.
>
> I am using Oracle 8.1.7 EE on Solaris 2.7.
>
> Thanks.
Received on Tue Apr 30 2002 - 18:32:01 CDT

Original text of this message

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