To create an unlinked or linked referential constraint, use the SQL DDL CREATE CONSTRAINT statement. CA IDMS/DB checks and rejects any invalid CREATE CONSTRAINT statements.
Considerations
Note: For steps and considerations involved with this process, see Chapter 30, “Modifying Schema, View, Table, and Routine Definitions.
Example
In the following example, a linked referential constraint has been created to make sure that the employee ID in the benefits table is a valid ID by checking it against the employee IDs in the employee table. The referential constraint is indexed and ordered by the fiscal year.
create constraint emp_benefits
benefits (emp_id)
references employee (emp_id)
linked index
order by (fiscal_year desc);
|
Copyright © 2014 CA.
All rights reserved.
|
|