This command adds a constraint using the same syntax as the Create Table command (see Constraint Definition for Local Tables).ADD [CONSTRAINT constraint_name] ...
![]()
You cannot add a Unique constraint if one is already assigned to the same column list. A Unique constraint works only if the values of the columns in the constraint columns list for the existing rows are unique or include a Null value.
![]()
Adding a foreign key constraint to the table fails if, for each existing row in the referring table, a matching row (with equal values for the column list) is not found in the referenced table.Assuming the current schema is PUBLIC, this example adds a foreign key constraint to the deptId column of the test table that references the rowId of the dept table.
| © 2012 Progress Software Corporation and/or its subsidiaries or affiliates. |