What to Recompile

As a rule:

Consider this example:

When you change the physical table definition of TABLE A (i.e. add columns, remove columns, or change their attributes), the TABLE A table, its indexes and its OAM must be recreated.

The question is, "Does the TABLE B OAM have to be recreated?"

TABLE B's validation check is to check that the Department Code exists when creating a new Employee (in TABLE B). Because the Department Code is in TABLE A, TABLE B's OAM must open TABLE A and perform a table look up. The check is not done by calling TABLE A's OAM.  Therefore, TABLE B's OAM must also be recompiled.

If not, an IBM i level check error will result. (For more information on level checks, see the IBM Database Guidelines.)

Reviewing your data model relationships will help you find any affected tables.  You must also be aware of any validation rules you have added involving table look ups.

If you have used batch control, you will also be required to recompile OAMs.

Also See

When To Recompile