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 All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts count contained values of several col... DB2 5
No new posts To join 2 tables and to join 3rd tabl... DB2 8
No new posts Create a specific record/file based o... SYNCSORT 8
No new posts Extract ISPF table column headings CLIST & REXX 2
No new posts Unload and Load ISPF Table TSO/ISPF 4
Search our Forums:


Back to Top