Solved

DROP COLUMN IN ORACLE7

Posted on 2004-09-14
7
876 Views
Last Modified: 2008-02-01
HI ALL..
HOW COLUMN CAN BE DROPPED IN ORACLE7
MUCH THANKS
0
Comment
Question by:mohd_osman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 33

Accepted Solution

by:
sajuks earned 50 total points
ID: 12052808
create a table newtable as select col1,col2,col3 from existingtablename(exclude the columns you dont want)
  drop the existingtablename
  rename the newtable as the existingtablename
// dont forget the table/data backup before trying this.

0
 

Author Comment

by:mohd_osman
ID: 12052860
i already know this way but i am asking
for direct DDL command
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12052865
Unless you have oracle 8i and above its not possible.
From your question i assume you have oracle 7 ?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 33

Expert Comment

by:sajuks
ID: 12052874
oracle 8i and above,
ALTER TABLE EMP DROP COLUMN ENAME;

Drop the column from a table
--------------------------
alter table TABLE_NAME drop column COLUMN_NAME
 /
0
 
LVL 7

Expert Comment

by:BobMc
ID: 12056256
Cant do it directly in oracle7  - create a view minus the columns you dont want, and reference that instead. Its normally not worth the hassle/risk of removing the column.
0
 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 12056259
Sajuks is correct, "drop column" is not supported in Oracle7.  One work-around that may help you is to rename the table, then create view that has only the columns you want.  If you do this, make sure that you check the grants on the table and give the same grants on the view.  Also, make sure that the column you do not want is not "NOT NULL".  If it is, you will have to change that if you want to support inserts through the view.
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12100954
Thanks for the points and grade
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question