Home » SQL & PL/SQL » SQL & PL/SQL » How to drop more than one column at a time
How to drop more than one column at a time [message #257707] Thu, 09 August 2007 01:06 Go to next message
dnreddy123
Messages: 3
Registered: August 2007
Location: Hyderabad
Junior Member

create table emp(empid number(3),name varchar2(10),basic number(5));

table created


now i want to drop empid and basic from emp table at a time
how is it?
please help me
Re: How to drop more than one column at a time [message #257719 is a reply to message #257707] Thu, 09 August 2007 01:29 Go to previous messageGo to next message
ammishra
Messages: 179
Registered: January 2007
Location: india
Senior Member
i am not sure ..but we can not do that in single command
Re: How to drop more than one column at a time [message #257737 is a reply to message #257719] Thu, 09 August 2007 01:53 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
I am not able to understand why do you need it but anyway the syntax is
 ALTER TABLE EMP DROP (<COL1>,<COL2>...)
Re: How to drop more than one column at a time [message #257740 is a reply to message #257737] Thu, 09 August 2007 01:58 Go to previous messageGo to next message
ammishra
Messages: 179
Registered: January 2007
Location: india
Senior Member

Hi,

i am getting following error.

alter table tmp11 drop(des,qty)
ORA-12983: cannot drop all columns in a table


oracle version is- 9.2.0.6

--Yash

Re: How to drop more than one column at a time [message #257743 is a reply to message #257740] Thu, 09 August 2007 02:01 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
desc tmp11

You only have the 2 columns in the statement you can't drop them all (as the message says).

Regards
Michel


Re: How to drop more than one column at a time [message #257754 is a reply to message #257740] Thu, 09 August 2007 02:15 Go to previous message
ammishra
Messages: 179
Registered: January 2007
Location: india
Senior Member
yes michle you are right Thx!!
Previous Topic: Updating table from anpther table ...Issue
Next Topic: How to fetch several values at a time...
Goto Forum:
  


Current Time: Fri Dec 02 18:37:51 CST 2016

Total time taken to generate the page: 0.36868 seconds