Try OpenEdge Now
skip to main content
SQL Development
OpenEdge SQL Data Definition Language : Maintaining data integrity : Referential constraints
 

Referential constraints

Relational databases often contain tables that have identical columns. To maintain referential integrity, the data in the columns must remain consistent. Referential constraints ensure this integrity.
In the following example, the value in the item_no column of the supplier_item table depends on the value in the item_no column of the item table. The item_no column of the supplier_item table references the item_no column of the item table. The item_no column is a foreign key in the supplier_item table.
CREATE TABLE supplier_item
(
suppl_no INTEGER NOT NULL PRIMARY KEY,
item_no INTEGER REFERENCES item (item_no),
quantity INTEGER
) ;
* Foreign key constraint