Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Posts
    5

    Unanswered: Altering Columns, DB2 version 7.2

    We wish to increase the size of decimal columns on some tables from (11,2) to (16,2) and change some varchar columns from varchar(20) to varchar(40). Am I correct in believing that the only way to do this in DB2 7.2 is to unload the table, recreate the table, and load the table?

  2. #2
    Join Date
    Jun 2006
    Posts
    471

    alter table

    this feature is not available in V7
    yes : unload/drop/create/load is the way to go
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  3. #3
    Join Date
    Oct 2005
    Posts
    5
    Well, that is somewhat primitive for a database. I realized they fixed it in v 8.0, but I am still somewhat surprised.

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    V7 has been "out-of-support" for 2 years. V8 has been available for about 4 years.

    But actually, V8 does not allow you to change a decimal column from (11,2) to (16,2), but you can increase the length of a VARCHAR.

    In 8.2 there is a stored procedure used by the GUI interface in the Control Center (or anyone who wants to invoke the procedure manually) that will export the data, drop the table, recreate the table with the new difinitions, and reload the data.

    I believe that DB2 Version 9 (now available) does allow you to change the decimal column definitions on the fly.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  5. #5
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    In 8.2 there is a stored procedure used by the GUI interface in the Control Center (or anyone who wants to invoke the procedure manually) that will export the data, drop the table, recreate the table with the new difinitions, and reload the data.


    the procedure is sysproc.altobj
    lack of details in info center makes it difficult to use (at least for me )

  6. #6
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    I guess it may be a consious decision not to document it ;-(

    Search for altobj in the db2 forum and you should find reference to a newsgroup posting ...


    the procedure is sysproc.altobj
    lack of details in info center makes it difficult to use (at least for me )
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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