Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2007
    Posts
    26

    Unanswered: Alter column in db2

    Hi team

    In db2 is it possible to alter column datatype

    example

    I have a table in that one column datatype is int

    i want to to make that column datatype as bigint

    i know that in db2 we cant convert like that

    except char and varchar

    Please provide solution if any

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    What version of db2 are you ?

    If DB2 9, then you should be able to do it ...

    DB2 Database for Linux, UNIX, and Windows

    If you are on v8, search for ALT_OBJ procedure, which can do the job in the background or generate scripts to get the change done

    HTH
    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Nov 2007
    Posts
    26
    Thanks
    if it is version 9 can i use commonds like this

    db2 " alter table sample alter column col set data type bigint"

    col is now int

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    i guess so ... why not try it on a test table ?

    Sathyaram
    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
  •