Referential integrity prevents you from introducing errors into your database.
Suppose you have the following ORDER PART table.
Order Number | Part Number | Quantity |
---|---|---|
PK | Not Null | |
FK | FK | |
1 | 1 | 110 |
1 | 2 | 275 |
2 | 1 | 152 |
Part number and order number, foreign keys in the PART NUMBER table, comprise the composite primary key.
Suppose you delete the row defined by the primary key value 1 in the PART NUMBER table. The foreign key for the first and third rows in the ORDER PART table are now inconsistent, because there is no row in the PART NUMBER table with a primary key of 1. This is an example of loss of referential integrity.
Vantage provides referential integrity to prevent this from happening. If you try to delete a row from the PART NUMBER table for which you have specified referential integrity, the database management system does not allow you to remove the row if the part number is referenced in child tables.
- Ensures data integrity and consistency.
- Increases development productivity.
Because Vantage enforces referential integrity across all platforms, you do not need to code SQL statements to enforce referential integrity constraints or write additional programs to ensure referential integrity for updates.
- Allows optimizations, such as join elimination.