Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Dropping a column from a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
chagoyal

New User


Joined: 03 May 2007
Posts: 11
Location: India

PostPosted: Tue Sep 25, 2007 1:09 pm    Post subject: Dropping a column from a table
Reply with quote

How can I drop an existing column (non key not null with default) from a table without dropping the table..

Please advice ..!
Back to top
View user's profile Send private message

chagoyal

New User


Joined: 03 May 2007
Posts: 11
Location: India

PostPosted: Tue Sep 25, 2007 1:10 pm    Post subject: Reply to: dropping a column from a table
Reply with quote

I forgot to mention I am using db2 v8.1
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Sep 25, 2007 5:12 pm    Post subject: Re: Dropping a column from a table
Reply with quote

chagoyal wrote:
How can I drop an existing column (non key not null with default) from a table without dropping the table..

Please advice ..!
You can't.
Back to top
View user's profile Send private message
mbr_raja

New User


Joined: 15 Nov 2004
Posts: 26
Location: Chennai, India

PostPosted: Wed Sep 26, 2007 5:21 pm    Post subject: Reply to: Dropping a column from a table
Reply with quote

There is no option to drop a specific column from table. The only option to change the table structure is to drop the specific table and recreate the new table with new definition.
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Wed Sep 26, 2007 5:49 pm    Post subject: Reply to: Dropping a column from a table
Reply with quote

Hi,

You can't drop a column from the table. If you want to delete a column form the table, DECLARE a new table with all columns except the column that you want to delete and insert the existing data into this new table. And now drop the old table.

Hope this helps.
KSK
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us