Working with Optim primary keys

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:

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:

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.


Feedback