Gossamer Forum
Home : General : Databases and SQL :

I want to drop column

Quote Reply
I want to drop column
I want to drop column from my oracle table...

I have table

create table abc (name varchar2(20),fname varchar2(20));

I want to drop column 'fname' from my table...

can anyone please tell me how to do so ?

regards,
Danish
Quote Reply
Re: [danish_ara] I want to drop column In reply to
Ya would need to use the ALTER function.

Example:

Alter table dbatest drop column ( c9 );

More info?

Go here: http://www.google.com/search?hl=en&ie=ISO-8859-1&q=alter+table+drop+column+Oracle
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] I want to drop column In reply to
the above table 'abc' I mentioned ... this command is not working...

alter table danish drop column (fname);

alter table danish drop column (fname)
*

Error: missing keyword.

so any idea ?...what to do next.

Remember I am working in oracle 8
waiting for reply,

Regards,

Danish

Last edited by:

danish_ara: Oct 25, 2002, 6:36 PM
Quote Reply
Re: [danish_ara] I want to drop column In reply to
Uh...yea, the codes I posted SHOULD and DO work with Oracle 8i. How do I know this? Because I use Oracle 8i and 9i at my job, buddy!

Why don't you post the ORA error you get? And there are MANY web sites that list ORA errors and how to fix your SQL to make whatever you trying to do work....
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [danish_ara] I want to drop column In reply to
Just remove the brackets from your statement and it should work.

e.g. alter table danish drop column fname

With the brackets you get a column or keyword not exist I think.
Quote Reply
Re: [danish_ara] I want to drop column In reply to
8i well if u were on 7.x u could have solved it by 3 simple steps

Step 1

create table temp as select name from abc

Dont Include the column name u want to remove in the select statement

Step 2 rename abc to xyx;

Step 3 rename temp to abc

:)

Precaution Pl Note that no views on abc table or any index created on abc table


=_= =_= =_= =_= =_= =_=


You can chain me, you can torture me, you can even destroy this body, but you will never imprison my mind.
-Mahatma Gandhi