Results 1 to 3 of 3

Thread: Alter Table

  1. #1
    Join Date
    Jan 2003
    Posts
    8

    Unanswered: Alter Table

    I'm trying to alter a column in a table defined with the IDENTITY attribute to SET GENERATED BY DEFAULT. IBM provides a beautifully written article at http://www7b.boulder.ibm.com/dmdd/li...fielding.html. The problem is I can't get it to work. I'm using version 7.2 on XP. I get the following from COMMAND CENTER:

    ------------------------------ Command Entered ------------------------------
    alter table A_TABLE alter column DESCR set generated by default

    DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0104N An unexpected token "generated by default" was found following "er column DESCR set". Expected tokens may include: "<space>". SQLSTATE=42601

    Does anyone know if this can be done?

    Thanks.

  2. #2
    Join Date
    Feb 2003
    Posts
    24
    If I'm not mistaken, after the creation of tables the properties of columns cannot be altered. You can alter some properties of table such adding column, primary key, foreign etc. Refer to SQL Guide it may help and also the GUI tool in altering tables.

    regards

  3. #3
    Join Date
    Jan 2003
    Posts
    8
    Thanks for the response. It certainly cannot be accomplished thru DB2's GUI. From that perspective one wonders why ALTER is even a menu item. However, if you visit the link that I provided it definitely says it can be done. I've also read elsewhere that it is possible to do. I was just wondering if there was someone out there in a real life situation using V7.2 that managed to do it.

    Thanks.

Posting Permissions

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