Previous Topic: Adding a Column to a TableNext Topic: Adding a Column to a Key


Deleting a Column from a Table

If you delete a column from a table that has constraints defined, the result varies depending on the type of constraint. This applies only if the column is not in a Unique or Foreign Key (see Deleting a Column from a Key). For example, Check constraints become obsolete, and Foreign constraints become invalid.

Type of
Constraint


Effect on Constraint

Check

Constraints become obsolete if the constraint is defined to the column being deleted, so the delete is not allowed. CA Datacom Datadictionary generates a DSF return code CON when this attempt is made. Drop the constraint before deleting the column from the table.

If the constraint is not defined to the column, the constraints become invalid because the offsets of other columns could change and therefore change the length of the table. The constraints are rebound by SQL the next time the table is accessed.

Foreign

Constraints become invalid because offsets stored in the object change. The constraints are rebound by SQL the next time the table is accessed.

Unique

Constraints become invalid because the offsets stored in the object change and because the length of the table also changes. The constraints are rebound by SQL the next time the table is accessed.

The referencing constraints also become invalid and are rebound by SQL the next time the table is accessed.