Home » SQL & PL/SQL » SQL & PL/SQL » Alter Table for insert the Column (Windows XP)
Alter Table for insert the Column [message #332963] Thu, 10 July 2008 03:42 Go to next message
cvs_1984
Messages: 136
Registered: August 2007
Location: Punjab, INDIA
Senior Member

Hi,

I want to Alter the Table for Insert a Column.


During the add Column they were inserted column as been placed between two column.


Ex:

Desc Mrvsjo

Name       Type  
SERIALNO   NUMBER(5)  
MRMNO      CHAR(8)  
DBTNOTEDT  DATE  
UOM        CHAR(4)  
MRQTY     NUMBER(15,3)  
PRNQTY     NUMBER(15,3)  
PENDQTY    NUMBER(15,3)  
JRONO       CHAR(8)  
DBREFCODE  CHAR(3)  

In this table add the part number in medial of the Column UOM and MRQTY.

If it possible. Pls reply me.

Thanking you.
Re: Alter Table for insert the Column [message #332964 is a reply to message #332963] Thu, 10 July 2008 03:45 Go to previous messageGo to next message
Michel Cadot
Messages: 64131
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/ Not directly possible
2/ You have to recreate the table
3/ You can create a view upon the table
4/ The real question is what do you need it to be in specific order?

Regards
Michel

[Updated on: Thu, 10 July 2008 03:45]

Report message to a moderator

Re: Alter Table for insert the Column [message #332982 is a reply to message #332964] Thu, 10 July 2008 04:20 Go to previous messageGo to next message
cvs_1984
Messages: 136
Registered: August 2007
Location: Punjab, INDIA
Senior Member

Hai Mr. Michel

Thanks for your immediate reply with answer


This request only for the future purpose. When we see the table column its uniform make every body to understand the data.


Re: Alter Table for insert the Column [message #333044 is a reply to message #332982] Thu, 10 July 2008 06:31 Go to previous messageGo to next message
Littlefoot
Messages: 20898
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What do you mean by the last sentence? Who is "everybody"? Do your users use TOAD or SQL Developer or similar GUI and manipulate with values directly? I hope not!

So, there *must* be front end which makes these data visible to end users. No matter what it is, but you should get used to name all columns you select, such as
SELECT deptno, dname, loc FROM some_table
(i.e. avoid use of SELECT *). Doing so, it really doesn't matter (generally speaking) what is the column position.
Re: Alter Table for insert the Column [message #333213 is a reply to message #332963] Thu, 10 July 2008 19:19 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
I like alphabetical order for my columns.

DBREFCODE CHAR(3)
DBTNOTEDT DATE
JRONO CHAR(8)
MRMNO CHAR(8)
MRQTY NUMBER(15,3)
PENDQTY NUMBER(15,3)
PRNQTY NUMBER(15,3)
SERIALNO NUMBER(5)
UOM CHAR(4)

Kevin
[EDITED by LF: disabled smilies in this post]

[Updated on: Fri, 11 July 2008 02:50] by Moderator

Report message to a moderator

Re: Alter Table for insert the Column [message #333214 is a reply to message #333213] Thu, 10 July 2008 19:29 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Why?
Re: Alter Table for insert the Column [message #333293 is a reply to message #333213] Fri, 11 July 2008 02:55 Go to previous messageGo to next message
Littlefoot
Messages: 20898
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
cvs_1984
When we see the table column its uniform make every body to understand the data.

Kevin
I like alphabetical order for my columns.

Heheheh! That must be some wow! model when alphabetical columns' order makes everyone understand the data.
Re: Alter Table for insert the Column [message #333408 is a reply to message #332963] Fri, 11 July 2008 10:24 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
pablolee, wrong question.

Right question is "why not?".

Kevin
Re: Alter Table for insert the Column [message #333412 is a reply to message #333408] Fri, 11 July 2008 10:34 Go to previous messageGo to next message
Michel Cadot
Messages: 64131
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Kevin Meade wrote on Fri, 11 July 2008 17:24
pablolee, wrong question.

Right question is "why not?".

Kevin

Because the best order is alphabetical order of datatype. Smile

Regards
Michel

Re: Alter Table for insert the Column [message #333416 is a reply to message #332963] Fri, 11 July 2008 10:41 Go to previous messageGo to next message
oracledinesh22
Messages: 3
Registered: July 2008
Junior Member
By using Query it is not possible but you can use GUI tool for this purpose.

Thanks
Dinesh
Re: Alter Table for insert the Column [message #333418 is a reply to message #333416] Fri, 11 July 2008 10:48 Go to previous messageGo to next message
Michel Cadot
Messages: 64131
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Which one? How?
In the end, doesn't the GUI make SQL or PL/SQL?

Regards
Michel
Re: Alter Table for insert the Column [message #333421 is a reply to message #333418] Fri, 11 July 2008 10:54 Go to previous messageGo to next message
Littlefoot
Messages: 20898
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Also, if you want to be highly sophisticated, you'd order columns azbukatically by column datatype, column length DESC.
Re: Alter Table for insert the Column [message #333437 is a reply to message #332963] Fri, 11 July 2008 11:42 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
hehehe good one...
Re: Alter Table for insert the Column [message #333441 is a reply to message #333421] Fri, 11 July 2008 11:54 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
I always order my columns by means of the average contents.
It takes a lot of reshuffling during the early days of an app, but it settles..
Re: Alter Table for insert the Column [message #333447 is a reply to message #332963] Fri, 11 July 2008 12:30 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
Maybe I a being nerdish but, I laugh harder with each reply, thanks guys, keep'm comming.

Kevin
Re: Alter Table for insert the Column [message #333467 is a reply to message #333447] Fri, 11 July 2008 15:11 Go to previous messageGo to next message
joy_division
Messages: 4641
Registered: February 2005
Location: East Coast USA
Senior Member
Kevin Meade wrote on Fri, 11 July 2008 13:30
Maybe I a being nerdish but, I laugh harder with each reply, thanks guys, keep'm comming.

Kevin


Ok, it's near the end of the day, so how about this one:

In 10g, I try to order the names of the columns by taking the difference between the hash value of the column name and the hash value of the schema name, which of course are all Star Wars characters. I never have a case where two column names have the same hash value as I am able to quickly compute this value in my head when naming columns.

In 9i, I was using Star Trek characters. When I go to 11g, I will probably use characters from Star Blazers.

[Updated on: Fri, 11 July 2008 15:12]

Report message to a moderator

Re: Alter Table for insert the Column [message #333468 is a reply to message #332963] Fri, 11 July 2008 15:27 Go to previous message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member

Quote:
In STAR WARS characters, your columns you name, YES

Previous Topic: ORA-00603: ORACLE server session terminated by fatal error
Next Topic: Decrypt PDF file
Goto Forum:
  


Current Time: Wed Dec 07 12:48:07 CST 2016

Total time taken to generate the page: 0.09192 seconds