DROP COLUMN IN ORACLE7

HI ALL..
HOW COLUMN CAN BE DROPPED IN ORACLE7
MUCH THANKS
mohd_osmanAsked:
Who is Participating?
 
sajuksConnect With a Mentor Commented:
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
 
mohd_osmanAuthor Commented:
i already know this way but i am asking
for direct DDL command
0
 
sajuksCommented:
Unless you have oracle 8i and above its not possible.
From your question i assume you have oracle 7 ?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
sajuksCommented:
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
 
BobMcCommented:
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
 
Mark GeerlingsDatabase AdministratorCommented:
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
 
sajuksCommented:
Thanks for the points and grade
0
All Courses

From novice to tech pro — start learning today.