alter table drop column [message #186497] |
Tue, 08 August 2006 04:34 |
steffeli
Messages: 112 Registered: July 2006
|
Senior Member |
|
|
Hello
Something is wrong with my syntax but I can't find out what's wrong.
alter table test
drop column prod1, prod2, prod3
The code works when I delete just 1 column. Any idea?
Thanks
Stefan
|
|
|
Re: alter table drop column [message #186500 is a reply to message #186497] |
Tue, 08 August 2006 04:46 |
|
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
I think you need individual alter table statements (although I didn't check the manuals ).
[EDIT]
I better did. It is possible
ALTER TABLE thetable DROP (col1,col2,...);
[EDIT 2]
And again, I edited this too late. navkrish and Littlefoot beat me.
MHE
[Updated on: Tue, 08 August 2006 04:54] Report message to a moderator
|
|
|
|
|
|
Re: alter table drop column [message #186505 is a reply to message #186497] |
Tue, 08 August 2006 05:04 |
navkrish
Messages: 189 Registered: May 2006 Location: NJ,USA
|
Senior Member |
|
|
amit_kiran,
If you want to drop all the column, it is better to drop the table itself...
but still if you try to drop all the columns of a table,then it will throw 'ORA-12983: cannot drop all columns in a table'
I guess, Stefan wants to drop more than one column at a time and not all the columns of table test.
Maheer, let me know if my comment is valid.
Naveen
[Updated on: Tue, 08 August 2006 05:08] Report message to a moderator
|
|
|
|
|
|
|
Re: alter table drop column [message #186512 is a reply to message #186505] |
Tue, 08 August 2006 05:11 |
amit_kiran
Messages: 50 Registered: July 2006 Location: UK
|
Member |
|
|
Yes i do agree with your statement.
ALTER TABLE TEST DROP(prod1, prod2, prod3);
this statement is valid only if you have one more column name
(prod4 NUMBER) in your table;
Correct me if i am on the wrong path..
|
|
|