Creating and Editing Offline Constraint Definitions
Create or edit a primary, foreign or unique key, or a check constraint
for an offline table definition. You can:
You can also create a new foreign key between modeled tables on a
database diagram. See Getting Started
with Database Modeling.
To create or edit a constraint definition using
the dialog:
-
In the navigator, expand the workspace, project and schema.
-
Expand Tables, and open the
Edit Offline Table dialog:
-
Select Edit from the table
definition's context menu.
or
-
Double-click the table definition.
-
Select Primary Key Information,
Unique Constraints Information, Foreign Key
Information, Check Constraint Information
to display information about existing constraints.
-
Click
to add a new constraint, and enter properties for it. For information about
how to fill these in values, click Help
in the dialog.
-
Click OK to save your changes.
Alternatively, you can edit constraint definitions directly on the
diagram.
To edit a constraint definition on the diagram:
-
In the constraint compartment (the third compartment on a modeled
table), select the constraint definition you want to edit. Click once
to select the right place, then click again to enter edit mode. You
may need to resize the table definition to see the constraint.
-
To edit an existing constraint, type your changes into the selected
line. The information displayed depends on the type of constraint. The
following illustration shows a primary key, a unique key and some
check constraints. The check constraint
EMP_SALARY_MIN
is
highlighted and the minimum salary has been changed to 10
.
Use the following formats:
-
Primary key
<<PK>>
--
<CONSTRAINT_NAME>: <SELECTED_COLUMN1>,
<SELECTED_COLUMN2>
...
-
Unique key
<<UK>>
--
<CONSTRAINT_NAME>: <SELECTED_COLUMN1>,
<SELECTED_COLUMN2>
...
-
Check constraint
<<Check>>
--
<CONSTRAINT_NAME>: <CONDITION>
-
When you press Enter or click elsewhere on the diagram the constraint
is updated.
Related topics
Creating New Offline Database Definitions
Working with Offline Database Definitions
Copyright © 1997, 2004, Oracle.
All rights reserved.