Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Location
    Inside Intel
    Posts
    165

    Post Unanswered: Renaming a column

    Hi all,

    DB2 8.1.5 on Win2000 server

    I have a table with data populated in it. I want to rename a column. Is there a "ALTER TABLE TableName RENAME COLUMN OldName TO NewName"?? Or do i have to drop and redo everything?

    Thanks in advance,
    Newbie

  2. #2
    Join Date
    Mar 2004
    Posts
    448
    No rename command.
    drop and create and redo all.
    use db2look to get the existing table information.

    regards,

    mujeeb

  3. #3
    Join Date
    Apr 2004
    Location
    Inside Intel
    Posts
    165

    Post Thanks!

    Thanks mujeeb!

    I wonder why that feature is not available in DB2. Anybody??

  4. #4
    Join Date
    Mar 2004
    Posts
    448
    The reason is simple, db2 keeps lot of information at the column level and any changes will invalidate and inoperative that other objects.
    Infact , in oracle until 9i release 2 they have no command of renaming the column and the reason at the oracle is that it keeps that information at the block level(not by name) and the same I think is for db2 at the page level

    regards,

    mujeeb

Posting Permissions

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