Importing schema changes with columns that require changes on IBM DB2 z/OS
On IBM DB2 z/OS, some column changes cannot be applied automatically, such as changing a column constraint from Null to Not Null. When you import schema changes, if the column cannot be changed automatically, the generated DDL includes the statement "change not allowed by DB2 zOS".
Work with your z/OS database administrator to modify the column and apply the necessary constraints. Pega recommends that you perform one of the following procedures:
Using the INSERT INTO SELECT statement
Modify a column and apply constraints with the INSERT INTO SELECT statement.
- Create a new table with the column change requirement and with no data.
- Copy the data from the original table by using the following statements:
INSERT INTO new_table
SELECT * FROM original_table
- Drop or rename the original table.
- Rename the new table with the same name as the original table. The new table must be in the same tablespace and schema as the original table.
Using the z/OS batch utility
Modify a column and apply constraints with the z/OS batch utility.
- Use the batch utility to unload the original table.
- Drop the table.
- Create a new table with the same name as the original table, with the required column change.
The batch utility includes the DDL of the original table. You can use this DDL to create the new table by modifying the column and adding the new constraint.
- Load the original data into the new table.