Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Dropping multiple columns in just one statement?

3003916Sep 16 2015 — edited Sep 16 2015

Dropping multiple columns in just one statement?

As far as can tell it is not possible.

I have looked at this link.

http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_3001.htm#i2103924

I thought I might be able to drop multiple columns with a statement like this:

ALTER TABLE HF_movie_table

   DROP COLUMN drama

  ,DROP COLUMN comedy

  ,DROP COLUMN action

  ,DROP COLUMN gore

  ,DROP COLUMN scifi

  ,DROP COLUMN for_kids

  ,DROP COLUMN cartoon

;

But that gives error  SQL Error: ORA-00933: SQL command not properly ended

As far as I can tell I must drop the columns one at a time unless I want to use a PL/SQL script.

like

ALTER TABLE HF_movie_table DROP COLUMN drama;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 14 2015
Added on Sep 16 2015
8 comments
3,564 views