Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COLUMN ORDER

Status
Not open for further replies.

mkey

Programmer
Oct 3, 2001
288
CA
hI ALL,
Let say I create a table like this design:
Table_A:col1,col5,col3,col4

Since I cannot rename a column in Oracle I drop col5 and add new column called col2.

When I do a describle on table_A:
col1,col3,col4,col2

My question is that is there a way to change the order so that I see(col1,col2,col3,col4)
Thank you!
mkey
 
If you can't change the underlying table structure, I would define a view which selected the columns in the order that you want.

If you are allowed to mess with the table definitions, I would try something like

create table t_1 as
(select col1, col2, col3, col4 from table_A.

You will have to be careful to recreate all indexes and other structures which aren't created along with the table.

After t_1 has been successfully created, you can drop table_A and rename t_1 to table_A.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top