Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Why cant we DROP Column in db2

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

New User


Joined: 08 Mar 2005
Posts: 54
Location: Chennai

PostPosted: Mon Jun 13, 2005 8:03 pm    Post subject: Why cant we DROP Column in db2
Reply with quote

As everyone knows we cant drop column in db2 but in one of my interview they asked why cant we drop column in db2.

can anyone please answer my question.
Back to top
View user's profile Send private message

ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Wed Jun 15, 2005 2:38 pm    Post subject:
Reply with quote

Hi,

The answer to your question is no. The only way to remove a column from an existing table is to DROP that table, and then re-CREATE it without the column you no longer require. As you correctly note, that means that all dependent tables, data, indexes, authorization, etc. will also be dropped. That is why there are DBA tools on the market that automate the process of dropping and then re-creating all of the impacted objects and data. One such tool is BMC Software's Change Manager.

You'd probably be better off just leaving the column there, but not using it. Of course, that could lead to confusion as people see the column and expect the data to be not only there, but accurate. You might consider creating a view that contains all of the columns except the one you wish to remove. Then assign your users and programmers authority to use the view, instead of the base table.

Thanks,
Reddy
Back to top
View user's profile Send private message
pkmainframe

New User


Joined: 14 Jun 2005
Posts: 16
Location: India

PostPosted: Wed Jun 15, 2005 4:13 pm    Post subject:
Reply with quote

Hi,
Answer to your question is no, either you drop the table, or create a new table/view excluding the column.


Tx
pk
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 DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us