Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: add a new column into the middle of an existing table
There are a couple of ways to do it, but as Daniel said, why bother?
1:
SQL> desc andy
Name Null? Type
------------------------------- -------- ----
COL1 CHAR(2) COL2 VARCHAR2(10) COL3 VARCHAR2(10)
SQL> !
oracle_at_nadir$ exp oradba/PASSWORD file=a.dmp log=a.log tables=andy
Export: Release 8.0.6.0.0 - Production on Wed May 1 15:00:32 2002
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Connected to: Oracle8 Enterprise Edition Release 8.0.6.0.0 -
Production
PL/SQL Release 8.0.6.0.0 - Production
Export done in US7ASCII character set and US7ASCII NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table ANDY 3 rowsexported
Table dropped.
SQL> create table andy(col1 char(2),col3 varchar2(10),col2 varchar2(10));
Table created.
SQL> desc andy
Name Null? Type
------------------------------- -------- ----
COL1 CHAR(2) COL3 VARCHAR2(10) COL2 VARCHAR2(10)
SQL> exit
Disconnected from Oracle8 Enterprise Edition Release 8.0.6.0.0 -
Production
PL/SQL Release 8.0.6.0.0 - Production
oracle_at_nadir$ imp oradba/PASSWORD file=a.dmp full=y ignore=y
Import: Release 8.0.6.0.0 - Production on Wed May 1 15:01:31 2002
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Connected to: Oracle8 Enterprise Edition Release 8.0.6.0.0 -
Production
PL/SQL Release 8.0.6.0.0 - Production
Export file created by EXPORT:V08.00.06 via conventional path . importing ORADBA's objects into ORADBA
. . importing table "ANDY" 3 rowsimported
SQL> desc andy
Name Null? TypeReceived on Wed May 01 2002 - 00:04:37 CDT
------------------------------- -------- ----
COL1 CHAR(2) COL3 VARCHAR2(10) COL2 VARCHAR2(10)