Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2009

    Unanswered: Cant move columns

    Hi, i use DB2 and i have created some tables. now i was "finished" but i forgot a column. i have added the last column and i wanted to move it up. there are zwo buttons to move columns up and down, but they are disabled. does andybody know, what i have to do to enable them???


  2. #2
    Join Date
    May 2009
    Provided Answers: 1
    Dosihris, The buttons are are disabled because you are not allowed to rearrange the columns of an already existing table. If you want to put the column in the 'middle' of existing columns you will have to drop and recreate the table (along with exporting / loading any data, recreating indexes, primary and foreign keys, etc.).

    The Up and Down arrows are enabled when you are creating a new table. Since the physical object doesn't exist yet, you can rearrange columns however you want.

  3. #3
    Join Date
    Aug 2009
    ah, thanks for the answer... but why is it soo hard to change a column in the database??? Microsoft SQL can it too... Now i'm in the design phase, but when there are data in my table, i can not drop everything... there are foreign keys and i would have to create the entire database again.. because of one column... that would be stupid...

  4. #4
    Join Date
    Apr 2006
    Provided Answers: 11
    why do you want to change the column sequence. this has no importance at all
    it is not because some other can do this, that they are superior. there are millions of things that db2 can do, that others can not
    you can add-drop a column, but I don't see any reason for moving a column in the sequence.Planning is the most important part of a db.
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified

  5. #5
    Join Date
    May 2003
    The actual physical order of the columns in the row is not the same as the logical order anyway. Db2 LUW will automaticlly put VARCHAR's at the end (at least when table is initially created).
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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