SQL Statements and Extensions for the Salesforce Driver : Alter Table : Altering a Local Table : Add Clause: Constraints

Add Clause: Constraints
Purpose
Use the Add clause to add a constraint to an existing table. It is optional.
This command adds a constraint using the same syntax as the Create Table command (see Constraint Definition for Local Tables).
Syntax
ADD [CONSTRAINT constraint_name] ...
Notes
Example A
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.
ALTER TABLE test ADD CONSTRAINT test_fk FOREIGN KEY (deptId) REFERENCES dept(id)

© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.