Previous Topic: Creating a TableNext Topic: Defining an Index


Defining a CALC Key

You create a CALC key by issuing the CREATE CALC statement and specifying a CALC key column.

Things You Can Specify

  1. Whether the CALC key is unique
  2. Name of the table associated with this CALC key
  3. Name of the column or columns that make up the CALC key

Considerations

Examples

In the following example, a unique CALC key is defined on the EMPLOYEE table. The CALC key consists of one column, EMP_ID.

create unique calc key on prod.employee(emp_id);

In the following example, a unique multi-column CALC key is defined on the BENEFITS table. The CALC key consists of two columns, EMP_ID and FISCAL_YEAR.

create unique calc key on test.benefits(emp_id, fiscal_year);