Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    14

    Unanswered: Alter table Alter column

    Version IBM DB2 Personal Edition 7.?? and IBM DB2 Server Edition 7.??

    Got all the patch.

    Command -
    ALTER TABLE table_name ALTER COLUMN "column_name" SET DATA TYPE DECIMAL(9,3)

    and

    ALTER TABLE table_name ALTER COLUMN "column_name" DECIMAL(9,3)

    error -
    DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor. During SQL processing it returned: found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<values>". SQLSTATE=42601

    I'm trying to alter a column from a Decimal (5,0) to a Decimal(9,3) there are value in the column.

  2. #2
    Join Date
    Feb 2004
    Location
    Copenhagen
    Posts
    220

    Unhappy

    Hi

    I don't think you can alter columns like that,
    and especially not i version 7.

    I think you will hav to move data to a new table
    with the requuired columns, drop the old table and
    rename the new.

    Some say that the new DB2 version - Stinger will make
    this possible

    HTH
    Kristian K. Hansen
    Project Supervisor
    National Board of Health

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    You can add a column, but you can only alter the length of a varchar on DB2 for Linux, UNIX, and Windows.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  4. #4
    Join Date
    Feb 2004
    Posts
    14
    Thank You all for your advice.

  5. #5
    Join Date
    Apr 2004
    Location
    Shenzhen
    Posts
    8
    in db2 , you cann't change the most column property , only can change the varchar length .etc .

Posting Permissions

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