Hello marvelsoft,
don't know if you can...
the "standard" approach would be to add thecolumn to the table
and then if necessary adjust the view that you normally use to access the table with to give the desired result...
BUT you shoul be using named column lists anyway rather than * in you selects
so that wouldn't be a problem.
Regards,
Lowfatspread
Main Topics
Browse All Topics





by: hongjunPosted on 2007-07-07 at 03:59:03ID: 19436968
I think there's no way to do it using a ALTER statement.
You will need to do it indirectly.
rename YOUR_ORIGINAL_TABLE as YOUR_NEW_TABLE;
create table YOUR_ORIGINAL_TABLE nologging /* or unrecoverable */
as
select Column1, Column2, NEW_COLUMN, Column3
from YOUR_NEW_TABLE;
Drop table YOUR_NEW_TABLE;
Select * From YOUR_ORIGINAL_TABLE; <<<<< now you will see the new column in the middle of the table.
But then to change the datatype of the new column, you do something like this
ALTER TABLE YOUR_ORIGINAL_TABLE MODIFY (NEW_COLUMN VARCHAR2(255));