InterSystems IRIS Data Platform 2019.2  /  Class Definition Reference  /  Class Definitions

Class Definition Reference
Foreign Key Definitions
Previous section           Next section
InterSystems: The power behind what matters   

Describes the structure of a foreign key definition.
A foreign key defines a referential integrity constraint. When a table containing a foreign key constraint is modified, the foreign key constraints are checked.
You can add foreign key definitions to persistent classes. They are not meaningful in other kinds of classes.
Note that you can also enforce reference integrity by defining relationship properties that connect the classes.
A foreign key definition has the following structure:
/// description 
ForeignKey name(key_props) References referenced_class(ref_index) [ keyword_list ]; 
ForeignKey EmpKey(EmpId) References MyApp.Employee(EmpID) [ OnDelete = cascade ];
See Also

Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-09-19 06:56:35