A primary key is the column or columns that
contain values that uniquely identify each row in a table. A database
table must have a primary key for Optim™ to
insert, update, restore, or delete data from a database table. Optim uses primary keys that are
defined to the database. However, you can also define Optim primary keys to supplement the primary
keys in the database.
A primary key is needed:
- In any table that is visited more than once in a
process, for example, a child table that has two or more parent tables
referenced in the access definition.
- To enable the point and shoot feature for a start
table.
Note: If a primary key is not defined and is required to perform a
specific task, an error message appears.
Types of Optim primary
keys
You
can define two types of primary keys:
- An explicit primary key applies to a single
table.
- A generic primary key applies to any tables
that have the same base name, column names, and attribute specifications,
but different creator IDs.
There is no difference in function or appearance
between generic and explicit primary keys. However, if a table has
keys of both types, the explicit primary key is used.
Naming conventions
The
fully qualified name of a primary key is the same as the fully qualified
name of the database table for which it is defined. This name consists
of: alias.creatorid.tablename.
- alias
- Alias that identifies the database where the table
resides (1 to 12 characters).
- creatorid
- Creator ID assigned to the table (1 to 64 characters).
- tablename
- Base table name (1 to 64 characters).
Note: - The combined total length of columns for a primary key is limited
to 3584 bytes.