Home » SQL & PL/SQL » SQL & PL/SQL » Regarding Oracle Columns
Regarding Oracle Columns [message #198682] Wed, 18 October 2006 04:25 Go to next message
balmcacit05
Messages: 6
Registered: July 2006
Junior Member
after creating a table in oracle is it possible to change the order of columns

for eg

Name
DOB
Address

after creating it can i change it to

Name
Address DOB
Re: Regarding Oracle Columns [message #198683 is a reply to message #198682] Wed, 18 October 2006 04:26 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
You can drop and add columns to the table, but there is no reason to do so - the order of the columns in a table makes no practical difference.
Re: Regarding Oracle Columns [message #198686 is a reply to message #198683] Wed, 18 October 2006 04:30 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
JRowbottom wrote on Wed, 18 October 2006 11:26
the order of the columns in a table makes no practical difference.
That's what I try to explain to one of our analysts for weeks now. http://www.orafaq.com/forum/fa/596/0/

MHE
Re: Regarding Oracle Columns [message #198783 is a reply to message #198682] Wed, 18 October 2006 09:06 Go to previous messageGo to next message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
Why does it matter, if your table desc is
Name
DOB
Address

and you want to use it as

Name
Address
DOB

Then simply

select name,address,dob from myfile;

or

insert into my_file(name,address,dob) values('smith','1313 mockingbird lane',to_date('01010001','mmddyyyy'));

The ONLY time the order of columns is significant is when you use the describe command, otherwise it is completely without relevance.

[Updated on: Wed, 18 October 2006 09:06]

Report message to a moderator

Re: Regarding Oracle Columns [message #198786 is a reply to message #198682] Wed, 18 October 2006 09:15 Go to previous message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
A silly solution.

Create a view by selecting in which order you want.

By
Vamsi.
Previous Topic: cursor help
Next Topic: Is there any subsitude of UNION and UNION ALL
Goto Forum:
  


Current Time: Tue Dec 06 15:58:46 CST 2016

Total time taken to generate the page: 0.11622 seconds