Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2003
    Posts
    33

    Unanswered: 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

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Not possible with ALTER TABLE Statement...

    Cheers
    Sathayaram
    Last edited by sathyaram_s; 08-02-04 at 14:01.
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    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.

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

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

    Hope this helps,
    Grofaty

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  6. #6
    Join Date
    Jan 2003
    Posts
    1,605
    My mistake, this alter table statement is just for LUW, not for z/OS.

    Grofaty

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •