If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Removing columns added to tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-02-04, 10:24
chas_dba chas_dba is offline
Registered User
 
Join Date: Sep 2003
Posts: 33
Removing columns added to tables

Can we delete/remove columns from tables , if they were added using alter table command. we are using db2 7.1 on os/390.
Any help is appreciated.
__________________
bs
Reply With Quote
  #2 (permalink)  
Old 08-02-04, 12:38
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Not possible with ALTER TABLE Statement...

Cheers
Sathayaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.

Last edited by sathyaram_s; 08-02-04 at 13:01.
Reply With Quote
  #3 (permalink)  
Old 08-02-04, 12:46
crisscross crisscross is offline
Registered User
 
Join Date: Feb 2004
Posts: 25
No, you have to drop and recreate the table. I unload the data, drop and recreate the table and access rights, and load the data back, minus the deleted columns. You may invalidate all plans referencing that table (check for plans in SYSIBM.SYSPLANDEP), so rebinds may be needed. Triggers and views on that tables will be lost too. The Admin. Guide has a bit on the "Implications of dropping a table" that you might want to read before you do this, especially if the table is in production.
Reply With Quote
  #4 (permalink)  
Old 08-03-04, 05:01
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

"ALTER TABLE remove colums" will be available in DB2 v8.2 for LUW!

Hope this helps,
Grofaty
Reply With Quote
  #5 (permalink)  
Old 08-03-04, 05:19
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Won't help people with DB2 for z/OS and OS/390. They may be working on it, but no announcement that I know about.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #6 (permalink)  
Old 08-03-04, 06:13
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
My mistake, this alter table statement is just for LUW, not for z/OS.

Grofaty
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On