Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see ALTER and BMC AMI Change Manager for Db2 13.1.

CREATE UNIQUE CONSTRAINT statement


The CREATE UNIQUE CONSTRAINT statement defines a unique constraint for a key in a table.

GUID-060366BF-80FF-4773-AB2E-5EA3E884AED5-low.png

CREATE UNIQUE CONSTRAINT tableOwner.tableName.

This option specifies the name of the unique constraint.

CREATE UNIQUE CONSTRAINT tableOwner.tableName.uniqueConstraintName

This option specifies the fully qualified name.

PRIMARYKEY

This option indicates whether the unique constraint is a primary key or a unique key. The following table lists valid values for the PRIMARYKEY parameter.

PRIMARYKEY parameter values

Value

Description

YES

Indicates that the unique constraint is a primary key

PRIMARYKEY YES is the default.

NO

Indicates that the unique constraint is a unique key

KEYCOLUMNS (columnName, ...)

This option specifies the primary key columns that are included in the definition of the unique constraint.

PERIOD BUSINESS_TIME

This option indicates whether the BUSINESS_TIME values are unique. The starting and ending columns of BUSINESS_TIME are defined in the table on which the index is created. The following table lists valid values for the PERIOD BUSINESS_TIME parameter.

PERIOD BUSINESS_TIME parameter values

Value

Description

YES

Specifies that the period of time defined by the starting time and ending time for each row of the table do not overlap.

NO

Specifies that the period of time defined by the starting time and ending time for each row of the table can overlap.


Related topic



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*