3.4.3 Unique Key
Mandatory.
Specify whether or not the key columns nominated are to form a unique key to the table.
Default=NO.
Rules
- NO (unchecked or not selected), indicates that the key columns nominated do not form a unique key to the table. This allows multiple records with the same key to exist in the table.
- YES (checked or selected), which indicates that the key columns are to form a unique key to the table. This means that one (and only one) record can exist in the table for any given key value.
Tips & Techniques
- When defining a new index over a physical table that already contains records and using the option make sure that there are no duplicate records (i.e.: key values) already in the table. If duplicate records do exist, then the compile will fail as this index cannot be loaded because of the duplicate records. The job log will indicate the cause of this problem. To correct, remove or change the duplicate records.
- LANSA automatically handles duplicate key errors and there is no need for user logic to handle or check for them.