Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see ALTER and BMC AMI Change Manager for Db2 13.1.

Editing a primary key


Use the following procedure to add or delete columns in an existing primary key. You can also drop a primary key from a table that existed before the subsystem was upgraded with the IBM CATMAINT utility. (A UCP object type will not be displayed in the Mixed List for this type of table.)

To edit a primary key

  1. On the BMC AMI Change Manager for Db2 Main Menu, select WORKID, and press Enter.
  2. On the WORKID Action Menu, type the name of the existing WORKID or type a wildcard pattern to display a list of work IDs. Then, select Specify Db2 definitions and press Enter.
  3. On the Object Specification panel, specify the name of a database, table space, and table (or use wildcard characters). Then, press Enter.
  4. On the Mixed List panel, type PK in the Act column adjacent to the table (TB) that you want to modify. A primary key is created if one does not exist.The Constraint Key Mixed List panel is displayed.

    ALUSUC2 ER   -------------------- Constraint Key Mixed list -------------------
    Command ===>                                                    Scroll. . PAGE
    WORKID  . . . . : RDACRJ.UC01                                 Commands: CANCEL
    Table  . . . : RDACRJ.TB_N2A
    Const Name . : TN2A_TS_1
    (C)opy column from the Table, indicate position in Key Columns
    using (A)fter/(B)efore, and press ENTER.
                                                               Lines 1 to 7 of 19
                                                                     More:     +
    Act         Colname                          Column Type      UDT Length Nl FP
    ************************************ TOP **************************************
    A    CONSTRAINT KEY .:
            1   TN2A_TS_1
    D       2   TN2A_C4_1
         PARENT TABLE . .: RDACRJ     TB_N2A
    C           C1                               CHAR                      3  N  N
                TN2A_C4_1                        CHAR                      4  N  N
                TN2A_C4_2                        CHAR                      4  N  N
                TN2A_C6_3                        CHAR                      6  N  N
                TN2A_C4_4                        CHAR                      4  N  N
  5. Specify the modifications to the columns in the constraint.

    Tip

    Some object names might be too long to be displayed on a panel. To view a long object name, position the cursor on the object name and press the ZOOM (F4) key.

    Modification

    Action

    To add a column

    Type C in the Act column adjacent to the column name or names that you want to use. Then, type A in the Act column adjacent to the Constraint Key.

    Note

    To select more than one name, type CC in the Act column adjacent to the first column name and CC in the Act column adjacent to the last column name.

    To delete a column

    Type D in the Act column adjacent to the column name below the Constraint Key.

    Note

    To drop the primary key from a table that has been created by using the IBM CATMAINT utility to migrate to a later version of Db2, type D in the Act column adjacent to every column.

  6. Press Enter.The Constraint Key Mixed List panel is displayed as shown in the following figure. The column added for the constraint is displayed below the constraint key.

    ALUSUC2 ER   -------------------- Constraint Key Mixed list -------------------
    Command ===>                                                    Scroll. . PAGE
    WORKID  . . . . : RDACRJ.UC01                                 Commands: CANCEL
    Table  . . . : RDACRJ.TB_N2A
    Const Name . : TN2A_TS_1
    (C)opy column from the Table, indicate position in Key Columns
    using (A)fter/(B)efore, and press ENTER.
                                                               Lines 1 to 7 of 20
                                                                     More:     +
    Act         Colname                          Column Type      UDT Length Nl FP
    ************************************ TOP **************************************
         CONSTRAINT KEY .:
        L   1   C1
            2   TN2A_TS_1
        D       TN2A_C4_1
         PARENT TABLE . .: RDACRJ     TB_N2A
                C1                               CHAR                      3  N  N
                TN2A_C4_1                        CHAR                      4  N  N
                TN2A_C4_2                        CHAR                      4  N  N
                TN2A_C6_3                        CHAR                      6  N  N
  7. Press END until the WORKID Action Menu is displayed.
  8. Update the associated index columns.
  9. Update the associated foreign key columns of the child table.

    Note

    The PKEYPROP keyword in the ALUIN input stream will propagate changes to the column data type or length.

    Now that the primary key has been modified, you can analyze the work ID and execute the worklist.



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*