Tech Tip: Conditions for Primary Keys
PRODUCT: 4D | VERSION: 13.4 | PLATFORM: Mac & Win
Published On: December 20, 2013
Primary key is used to uniquely identify every row in the table. Primary keys can be a single field, or a combination of multiple fields.
The conditions that a Primary key must satisfy are the following:
- The primary key must be unique for every record in the table
- The primary key cannot be null (must have a value)
- The primary key’s value should not change
- Only one primary key defined for each table
- If the primary key consists of more than one field, the combination of values must be unique for every record in the table
Note: Primary keys that consist of multiple fields (also known as compound keys) are currently not directly supported by 4D.
See Also:
Commented by Maurice Inzirillo on June 12, 2014 at 11:45 PM
With 4D 13.5 a primary key MUST be indexed too ! IF not, you will get an error when you will try to add or modify a record. It's not the case with 4D 13.4 and 4D 14.1