Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2012

    Unanswered: Renaming columns

    I need to rename columns in referential tables.
    The tables are pretty elementary with just indexes and primary keys. There are no foreign keys.
    However I'm using DB2 9.5 LUW and apparently an ALTER TABLE <TABLE_NAME> RENAME COLUMN <OLD_NAME> TO <NEW_NAME> works only on version 9.7 onward.

    Is this true?

    If so is there a workaround?

    I don't want to DROP...CREATE the table since then I'd have to repopulate it with its original data, redefine indexes, primary keys and comment on all the columns again.

    Any ideas?



  2. #2
    Join Date
    Apr 2012
    Provided Answers: 17
    DB2 V9.5 LUW lacks rename-column syntax, as confirmed by the documentation.
    Consider using the ALTOBJ procedure, after careful study of the docs, and rehearsing on a test environment

  3. #3
    Join Date
    Jan 2003
    Provided Answers: 5
    Better yet, since V9.5 support ends on 4/31/2015 (next month), just upgrade to a new version that supports the column rename. Again, you should test this first.


  4. #4
    Join Date
    Dec 2007
    Richmond, VA
    Provided Answers: 5
    This phenomena is something I had not seen before my present assignment. In all of my past there were occasions that someone would ask about changing the name of something. The answer was always the same "No.". Same with dropping a column that was no longer in use. Why go through all the risks/costs involved with that type of task for no real benefit?This latest assignment though its an almost weekly event. Drop this table to remove column xyz_its_no_longer_used. Drop and recreate for??? It seems before I arrived here they had never thought about the risks and costs associated with such changes. We are still dropping tables, but not quite as much as when I first arrived.

Tags for this Thread

Posting Permissions

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