Table Alter Option
You can alter a table by using the following:
- DB2 ALTER TABLE statement
- Table alteration functionality withinCA RC/Update™ for DB2 for z/OS
Changes that you cannot make by using a DB2 ALTER TABLE statement must be made by dropping and recreating the table with the new definition. If supported changes are combined with unsupported changes, the table must be dropped and re-created. When the table is dropped, all data, dependents, and security are also dropped.
The RC/Alter facility within CA RC/Update fully supports the alteration of any DB2 table attribute. If DB2 does not support the requested alteration, the RC/Alter facility performs a drop and re-creation. This activity includes saving and restoring all data, dependents, and security of the table. CA RC/Update does not differentiate between catalog tables and non-catalog tables. Therefore, if a table alteration involves changing or removing the database name and the Data Cap setting, a table drop is required.
When RC/Alter is invoked, a data set is populated with the DDL for dropping and recreating the table. To perform the alteration, you must execute the DDL through the Batch Processor. The actual alteration can be scheduled for a particular time.
To use the table alteration functionality, access the Table Alter panel from the CA RC/Update main menu. On this panel, you can edit table information as needed. You can also use the COMPARE command to compare the current version of the table with the edited table. For more information about the COMPARE command, see the online help.
Confirming the Alter
After all information has been entered, press the End key (F3). Depending on the type of alter performed, one of the following results occurs:
- If the changes can be made with a standard DB2 ALTER TABLE command, a confirmation screen appears, from which you can accept or reject the generated DDL. You can also make modifications to the generated DDL before accepting it.
- If the changes require an CA RC/Migrator analysis or if the current operation mode of CA RC/Update is A, the RC/Alter screen appears, from which you can perform one of the following actions:
- Enter the required information, press Enter, and then use the Batch Processor (BP) facility to execute the generated DDL.
- Enter END to return to the Table Alter screen without invoking RC/Alter.
- Enter CANCEL to exit RC/Alter and discard your changes.If a CA RC/Migrator analysis is required to generate the DDL necessary to make your changes, an O or B Operation Mode setting is ignored.
- The analysis phase generates all statements that are necessary to alter the table or to drop and re-create the table, data, dependents, and authorizations.
ALTER Return Codes
The following describes the ALTER return codes:
- 4Indicates that a condition has been detected that might need user attention. The DDL will most likely execute, but there might be a problem with the view. You should examine the view text. Warning messages will supply you with further information.
- 8Indicates that a condition has been detected that needs user attention. The resulting DDL will not execute, and a DB2 SQL error will result. You should review the DDL to determine what needs to be done to correct the source of the error return code.