NexusDB fully supports Referential Integrity between tables, to help ensure data integrity. Typically, it is set up so that records in a master table cannot be deleted or the master ID field modified if there exists matching records in a details table; records cannot be inserted in the detail table without a matching master record. However, the allowable actions also include other uses.

The tables involved can be separate physical tables, embedded (child) tables in the same physical file, or even self-referencing.

RI is set up between one or more field(s) in a source table and an index in the target table containing at least the number of fields selected in the source table. Field types do not have to match; data conversions will be performed as required.

The allowed actions are:

Block delete

master table record can't be deleted if detail record exists

Block modify

master table RI field(s) can't be modified if detail record exists

Cascade delete

if master table record is deleted, delete detail records

Cascade modify

if master table RI field(s) are modified, modify detail records

Clear delete

if master table record is deleted, clear RI field(s) in detail table

Clear modify

if master table record is modified, clear RI field(s) in detail table

Set default delete

if master table record is deleted, set RI field(s) in detail table to the defined default value(s)

Set default modify

if master table record is modified, set RI field(s) in detail table to the defined default value(s)

Target required

requires that a matching record exists in the other table

Home | Site Contents | Documentation | NexusDB Manual V4 | Architecture and Concepts | NexusDB Concepts | Transactions and Data Integrity