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
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
When developing tables in a parent-child relationship, use a primary key and a foreign key along with a unique ID to make your database easier to ... Continue Reading
IBM did not change the default of the reuse deleted files function to YES for physical files in order to minimize the impact on any existing ... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.