Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

Removing constraints

We have files that are heavily used. Is it possible to run a CHGPF without removing referential constraints and restricting file access? We are pushing towards a 24 X 7 enviroment.
You have updated the DDS source for the file and are issuing the CHGPF command to add and/or remove fields from the table without recompiling and repopulating the files (similar to the SQL Alter Table command).

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.


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)

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.