Try OpenEdge Now
skip to main content
DataServer for Oracle
The DataServer Tutorial : Managing server attributes : Defining constraint definitions in Data Administration : Defining a primary key constraint definition
 
Defining a primary key constraint definition
The following procedure describes how to define a primary key constraint definition.
To define a primary key constraint definition:
1. Start Data Administration and connect to the OpenEdge database you are migrating.
2. Select DataServer > ORACLE Utilities > Server Attributes > View/Maintain Foreign Constraints. The View/Maintain Foreign Constraints dialog box appears.
3. Select the table for which you are defining a primary key constraint definition and click Create Constraints. The Create Foreign Constraint Definition for tablename dialog box appears, as shown in the following figure .
Figure 15. Create Foreign Constraint Definition for tablename dialog box
4. Accept the default constraint definition name, or enter a new one.
5. Select an index for the primary key constraint definition. Only indexes with an I in the All Columns Mandatory column are recommended for the primary key constraint definition. As long a column is unique, you can select as the primary constraint. Note, however, that the columns designated as the primary constraint are migrated as NOT NULL capable. That is, if you store many records in your OpenEdge database with the unknown value, they cannot be migrated to the foreign data source, given the defined primary constraint on that server object.
6. By default, the primary key constraint definition has the Active check box checked. Leave this box checked if you want the constraint definition you are defining to be available for migration.
7. Optionally, add a description of the constraint definition in the Description box.
8. Click OK to save the constraint definition and exit the dialog box. Click Create to save the constraint definition and remain in the dialog box to define more constraints for the selected table.
If the primary constraint definition is incorrectly defined, a message is displayed and the constraint definition is not created.
The system fails to generate a constraint definition when an index is not defined as unique by the presence of either an OpenEdge unique attribute (indicated by an I) or by a unique constraint definition (indicated by a C) in the Unique column.