User Guide : 7. Working with Tables : Foreign Keys, Indexes, and Constraints : Constraints
 
Share this page                  
Constraints
You create constraints using the New Constraint dialog (see New Constraint Dialog). You can reach this dialog in the following way.
Preconditions:
An installation must be connected to.
The Constraints folder child node of a table node must be selected in the Instance Explorer.
Access Route:
From the context menu: New Constraint
New Constraint Dialog
You use the New Constraint dialog to create constraints. You access this dialog as described in Constraints.
The New Constraint dialog contains the following fields:
Name
Specifies the name for the constraint
Constraint Type
Specifies the type of constraint:
CHECK (not available for Actian Vector databases)
UNIQUE
PRIMARY KEY
Expression
Specifies the expression to define the constraint
The dialog contains the following controls:
OK
Creates the new constraint
Close
Closes the dialog without creating the constraint
Create a Constraint
You create constraints with the New Constraint Dialog. You access this dialog by one of the routes explained in Constraints.
To create a constraint
1. Drill down through the connected installation in the Instance Explorer, open the Databases folder, and locate the database containing the table you want to create a constraint in.
2. Open the table node in the Instance Explorer to display its subfolders.
3. Right-click the Constraints folder and select New Constraint from the context menu.
The New Constraint dialog opens (see New Constraint Dialog).
4. Enter a name for the constraint in the Name field.
5. Select a constraint type from the drop-down menu.
6. Enter the expression that defines the constraint in the Expression field.
7. Click OK.
Delete a Constraint
You delete constraints using the Delete Constraint dialog.
To delete a constraint
1. Drill down through the connected installation in the Instance Explorer, open the Databases folder, and locate the database containing the table from which you want to delete a constraint.
2. Open the table node in the Instance Explorer to display its subfolders, and open the Constraints folder.
3. Right-click the constraint you want to delete and select Delete on the context menu.
The Delete Constraint dialog opens.
4. Select the constraint to delete.
5. Set the type of update for the deletion: RESTRICT or CASCADE.
6. Click OK.
The constraint is deleted.