DB Interface Module User’s Guide : PART II Using the Basic Features : Chapter 4 The Database Classes : Table Constraints
Table Constraints
The DB Interface Module supports a range of SQL table constraints used to enforce rules on the data allowed in a table. If a user attempts to insert, update or delete data that does not conform to the requirements of the constraint, it is rejected. This ensures the integrity and reliability of the data.
Constraints can be assigned on a column or table level. Column level constraints apply only to one column, while table level constraints can apply to multiple columns or the whole table.
Column level constraints supported by the DB Interface Module include not null constraints, identity column constraints and default column constraints. At the table level, the module supports unique table constraints, check constraints, primary key constraints, and foreign key constraints.
Table Constraints Classes
In addition to the multiple methods on various database classes, specific classes that support table constraints include:
RWDBIdentityConstraint
RWDBUniqueConstraint and RWDBUniqueConstraintList
RWDBCheckConstraint and RWDBCheckConstraintList
RWDBPrimaryKey
RWDBForeignKey and RWDBForeignKeyList
Figure 3 illustrates the architecture of the constraint classes.
Figure 3 – Database Constraints Classes