Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: add a new column into the middle of an existing table
I like having the column where I want it expescially if it exists that way
in another database instance.
rename old_table to old_table_bak;
copy from user/password_at_sid --
to user/password_at_sid --
create old_table --
using --
select "column list with new column in order you want" --
from old_table_bak;
Of course you will lose the indexes and/or constraints on the table. So, they will have to be recreated.
Bill Garcia
Tampa Florida
"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 Wed May 01 2002 - 22:09:00 CDT