In some cases, this can be done without removing any constraints. Adding new fields to the file is done without any sort of warning message from the operating system. If fields have been removed, you will be issued a warning message, but you can respond with an 'I' to ignore it and instruct the system to go ahead and remove the field. Even if the file has been defined with a constraint and the field being removed is a referential constraint key, the CHGPF command should remove both the field and the constraint. However, if the file is a referential constraint parent file and the field being removed is a parent key, the CHGPF command will fail.
The CHGPF command requires an exclusive-no-read lock on the file, so if any user has the file open, the CHGPF cannot be issued.
MORE INFORMATION ON THIS TOPIC
Visit the ITKnowledge Exchange and get answers to your DB2 questions fast.
Check out this Search400.com Featured Topic: Expert advice on DB2
Search400.com's targeted search engine: Get relevant information on DB2/400.
Dig Deeper on DB2 UDB (universal databases)
Related Q&A from Kent Milligan
Create a host variable of the where in statement on the fly with dynamic SQL. Continue Reading
To solve the SQL error -321 on IBM i6.1, use the new values statement to overcome the error. If you are using an older release, declare a cursor ... Continue Reading
When working with DB2 files with columns that have both short and long names, there is no option choose which column names are returned via ODBC ... Continue Reading