If a change in the dictionary affects a database table, directly or indirectly, this change needs to be applied to the database table. This is called the database table adjustment.
There are three different approaches for adjusting the database table:
- ALTER TABLE
Using this SQL statement, the dictionary tool can change (alter) the table layout on the database. Data in the table gets adjusted if necessary. However, not every change can be implemented using ALTER TABLE. In particular, changes that imply the risk of data losses or conversion errors are not implemented with ALTER TABLE.
- Delete and Create
This is the simplest approach. The database object gets deleted and created again based on the changed definition. This is of course only a good idea if the table is empty, or if the data stored in the table is redundant.
- Table Conversion
In this procedure, the table is first created on the database under a new name. Then the data is copied from the old table to the new table, converting it if necessary. Finally, the old table is deleted and the new table is renamed to replace the old table.
During a table conversion, a partial loss of data is possible, for example, when you remove a table field or reduce its length. Runtime errors can occur if you change the primary key or the type of an existing table field.
Activating Changes - Decision Tree
Play the video to learn more about activating changes.