Start of change

-542   column-name CANNOT BE A COLUMN OF A HASH KEY, PRIMARY KEY, A UNIQUE CONSTRAINT, OR A PARENT KEY BECAUSE IT CAN CONTAIN NULL VALUES

Explanation

A column that is identified in a HASH KEY, a PRIMARY KEY, a UNIQUE constraint clause, or a parent key (through a REFERENCES clause) is defined to allow null values. Null values are not permitted for these keys and clauses.

System action

The statement cannot be processed.

Programmer response

In the case of a column identified in a HASH KEY, a PRIMARY KEY or a UNIQUE constraint clause, correct the statement and resubmit it.

In the case of a column identified in a REFERENCES clause:

  1. Drop the parent table.
  2. Recreate it with referenced columns defined as NOT NULL.
  3. Resubmit the statement.

SQLSTATE

42831

End of change