Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2010
    Posts
    1

    Unanswered: how to delete the column having data in the column in EB2

    Can any one help me regarding the deleting the column while having values in that column In DB2.

  2. #2
    Join Date
    Jan 2010
    Posts
    335
    Could you be more specific? What do you want to achieve?

  3. #3
    Join Date
    May 2009
    Posts
    508
    Provided Answers: 1
    If you are using DB2 LUW V9.7, you can use the ALTER TABLE DROP COLUMN command.
    If you are using a version of DB2 that does not have this command, you will need to save the data (export / unload) without the column you want to remove, drop the table, create the table without the column, and then put the data back into the table (load / insert).

  4. #4
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    actually, without being able to spell the name of the database you are working on you should not attempt any of this.

  5. #5
    Join Date
    Jul 2009
    Location
    NY
    Posts
    963
    Create the new table having structure you need, and

    Insert INTO new_tbl
    select <remein colums> from old_tbl;


    Lenny

  6. #6
    Join Date
    Jul 2009
    Location
    NY
    Posts
    963
    Or (best way) create view from your tables, shown only columns needed to you.

    Lenny

Posting Permissions

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