PrimaryKey Object

<< Click to Display Table of Contents >>

 

PrimaryKey Object

A PrimaryKey PrimaryKey object object represents a collection of Fields that identifies uniquely every record on a table. As in a table's main index, a Primary Key is used to link data among tables. Some examples of primary keys are client codes, social security numbers, etc. After defining a Field as a table's Primary Key, the Database itself makes sure that no duplicated data is inserted in this Field. For example, if users try to add an order with the same number of an existing order, that record is not added and an error message is displayed. There are two types of Primary Keys, Simple and Compound.

A Simple Primary Key is a Field that identifies uniquely each record of a table. A Compound Primary Key can be formed by the combination of two or more Fields of a table. There may be cases in which a single Field cannot work as a Primary Key because it contains repeated values. In addition, a table can only have one Primary Key, whether it is simple or compound, that is, users cannot define two or more Fields from a table so that each one of them be a separate Primary Key. However, this is not the case of a compound Primary Key, where two or more Fields are combined to form a table's unique Primary Key.

When selecting Fields for a Primary Key, please consider the following details:

No duplicated or null values are allowed

If there is no unique identifier for a certain table, users can use a Field that generates records sequentially

 

To insert a PrimaryKey object in a Historic, right-click the Historic and select the Add - PrimaryKey option. Please check topic Primary Key Field for more information about Fields that can be inserted in this object.

Was this page useful?