IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Remove some columns from DB2 Table.


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Mon Jul 16, 2007 1:47 pm
Reply with quote

Hi All,
I have a table which currently have 5 columns.

2 columns in the table are useless and hence I want to remove the 2 columns from the table.

I believe we do not have DROP COLUMN facility in DB2.

Hence for achieving this one option that I think about is copying the current table values into temporary table and then drop the old table and recreate it with required columns and copy the data from the temporary table to the new table.. But this seems to be a costly affair..

Could anyone suggest any other option or method to achieve this..

Thanks in advance
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Jul 16, 2007 1:51 pm
Reply with quote

Huzefa,

You cannot delete columns from a non-empty table. You need to follow the approach mentioned in your post.
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Mon Jul 16, 2007 7:20 pm
Reply with quote

Thanks for the reply

But other than the way I mentioned, is there some another way how I can acieve my purpose
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Remote Unload of CLOB Columns DB2 6
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top