AMT Help Files

Reorganizing the Database

Whenever you make changes to the database structure of your application, a reorganization of the runtime database is required. Database reorganization is always needed after any of the following changes:

  1. Adding a new database object (either a table, index or foreign key)
  2. Modifying a database object
  3. Installing/upgrading a new version of AMT-COBOL

When adding/modifying a database object, the following steps need to be performed:

If the property "NullValues" for a table field is set to "False" (done via the Object Inspector), after previously having a value of "True", the reorganization process will check whether there are NULL records for this field. If there are NULL records, these will be updated to an empty string of alpha fields or, in case it is a numeric field, to "0". Also the attribute "NOT NULL" will be set in the database. This way, the database management software guarantees the NOT NULL condition, should applications outside of AMT-COBOL add or modify records on the table.
When a Boolean table field is added the Reorganization will leave the value of the field empty (space) regardless of the initial value set in the definition. When reading back a space is treated as Null. The new field must be set to either 'T' or 'F' before it can be used, especially if the new field is to be used as Key in an Index.
Note: When using a report to set the undefined Boolean fields to false, you have to set them to true first, update the record and then to false and update again.

When installing/upgrading a new version of AMT-COBOL, the following steps need to be performed:

If it is the first time that AMT-COBOL is installed, or if AMT-COBOL has been upgraded through a new patch or major release, you will have to do a full generation of every AMT-COBOL application. This is needed to make sure that all internal AMT-COBOL system tables are created according to the most recent AMT-COBOL version.