Manage Generic Primary Keys

Some databases contain sets of tables that are identical except for the Creator ID. Rather than define an explicit primary key for each table, define a generic primary key for all tables that have the same base name, regardless of the Creator ID.

You can:

Convert to a Generic Primary Key

In the Primary Key Editor, select Generic from the Tools menu to convert a database primary key or explicit Optim primary key to a generic primary key.

A primary key defined to the database is immediately converted to generic. If you select an explicit Optim primary key, you are prompted to retain or delete the original primary key. If you choose to retain the original, changes to the generic primary key have no effect on the original explicit primary key.

When you convert a primary key to generic, the Base Creator ID in the Primary Key Editor displays the Creator ID of the explicit primary key. The notation, Untitled is displayed in the title bar until you save the generic primary key. After you save a generic primary key, the Creator ID portion of the primary key name is replaced with an asterisk ( * ), for example, dbalias.*.tablename.

Respecify the Base Table Creator ID

You can use generic primary keys for any tables that are identical except for the Creator ID. If the base table associated with the generic primary key changes, you can specify a different Creator ID.

To display the Respecify Base Table Creator ID dialog, select Modify Base Table from the Tools menu in the Primary Key Editor.

respecify base table creator ID panel, described below

Base Table

Name of the base table used to create the generic primary key.

Creator ID

Creator ID associated with the base table. To change the Creator ID, click the down arrow to select from a list, and select OK.

Your selection is displayed as the Base Creator ID in the Primary Key Editor. You may then save the generic primary key.