Home » SQL & PL/SQL » SQL & PL/SQL » drop
drop [message #227457] Wed, 28 March 2007 05:23 Go to next message
pavuluri
Messages: 247
Registered: January 2007
Senior Member
how to drop one column in table
Re: drop [message #227463 is a reply to message #227457] Wed, 28 March 2007 05:26 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

alter table drop column

Regards
Michel
Re: drop [message #227466 is a reply to message #227457] Wed, 28 March 2007 05:32 Go to previous messageGo to next message
martijn
Messages: 283
Registered: December 2006
Location: Netherlands
Senior Member
SQL> create table blabla as select * from user_objects;

Table created.

SQL> desc blabla
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 OBJECT_NAME                                        VARCHAR2(128)
 SUBOBJECT_NAME                                     VARCHAR2(30)
 OBJECT_ID                                          NUMBER
 DATA_OBJECT_ID                                     NUMBER
 OBJECT_TYPE                                        VARCHAR2(18)
 CREATED                                            DATE
 LAST_DDL_TIME                                      DATE
 TIMESTAMP                                          VARCHAR2(19)
 STATUS                                             VARCHAR2(7)
 TEMPORARY                                          VARCHAR2(1)
 GENERATED                                          VARCHAR2(1)
 SECONDARY                                          VARCHAR2(1)

SQL> alter table blabla drop column object_name;

Table altered.

SQL>


If you are trying to drop a column of a SYS owned table you will probably get the following :
SQL> alter table blabla drop column owner;
alter table blabla drop column owner
*
ERROR at line 1:
ORA-12988: cannot drop column from table owned by SYS
Re: drop [message #227467 is a reply to message #227463] Wed, 28 March 2007 05:32 Go to previous message
pavuluri
Messages: 247
Registered: January 2007
Senior Member
thanks
srinivas
Previous Topic: Load Data
Next Topic: Get latest Access record for each User
Goto Forum:
  


Current Time: Fri Dec 09 17:24:42 CST 2016

Total time taken to generate the page: 0.30621 seconds