Home » SQL & PL/SQL » SQL & PL/SQL » insert a new column in specific position (oracle9i,MySQL)
insert a new column in specific position [message #315965] Wed, 23 April 2008 06:23 Go to next message
dba_01
Messages: 8
Registered: January 2008
Junior Member
how to insert a column in a specific position

EX:
column : id,ename,sal,hiredate

i want to insert a column (address) in 3th postion.


regards
Re: insert a new column in specific position [message #315966 is a reply to message #315965] Wed, 23 April 2008 06:29 Go to previous messageGo to next message
pablolee
Messages: 2836
Registered: May 2007
Location: Scotland
Senior Member
1. You cannot do this.
2. You can drop and re-create the table if you insist on the columns being in a particular order.
3. Having the columns in a particular order is pretty much pointless.
4. This question is asked on a regular basis. If you had searched, you should have quite quickly discovered this information.
Re: insert a new column in specific position [message #315980 is a reply to message #315966] Wed, 23 April 2008 06:55 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
pablolee
if you insist on the columns being in a particular order ...

... create a VIEW (based on a table) which will have columns in this particular order.
Re: insert a new column in specific position [message #315981 is a reply to message #315980] Wed, 23 April 2008 06:56 Go to previous message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Littlefoot wrote on Wed, 23 April 2008 13:55
pablolee
if you insist on the columns being in a particular order ...

... create a VIEW (based on a table) which will have columns in this particular order.

... or use DBMS_REDEFINITION package.

Regards
Michel

Previous Topic: how to use wildcard character &
Next Topic: Dynamic SQL for this SQL?
Goto Forum:
  


Current Time: Fri Dec 09 23:19:14 CST 2016

Total time taken to generate the page: 0.11086 seconds