The following table describes how changes to the database affect data independence:
| Modification Type | Independence Rules |
|---|---|
|
Adding tables |
Tables can be freely added to the database without affecting existing programs |
|
Deleting tables |
Tables can be deleted without affecting existing programs provided that Programs do not access that table, or use it as an index to another table. The database will need to be reorganised if the table contained data, or indexed a table containing data. |
| Adding a field |
Non-key fields can be added without affecting existing programs. If a key field is added to a table that contains data, the database must be reorganised, and programs that access the table will need to be modified. |
| Deleting a field |
Non-key fields can be deleted. Programs written before the deletion will 'see' a dummy value. For C, D and U fields, the null value is seen. |
| Changing the field description |
The field description is the data type, occurs, length and scale factor of a field. The rules for data type conversion are shown in the section on Data Type Conversion. Character fields reduced in length are truncated. Character fields increased in length are padded with blanks If the field description of a key field is changed, programs that access the table will probably need to be altered and recompiled. If the field description of a non-key field is changed, existing programs do not need to be recompiled. DP4 will convert the value to the format accepted by the program. |
| Changes to the key |
In theory programs do not need to be recompiled. In practice programs will need to be altered and recompiled in this situation. The database will need to be rebuilt if there is data in the table, or the table indexes a table that contains data. |