Previous Topic: -181 - ROW HELD BY PREVIOUS LOGICAL UNIT OF WORK WAS UPDATEDNext Topic: -183 - MUST SPECIFY DATACOM SQLMODE FOR CURSORS TO SURVIVE UNITS OF WORK


-182 - UNIQUE/PRIMARY CANNOT BE SPECIFIED DUE TO NULL ON nnnnnn

Explanation

During an SQL CREATE or ALTER TABLE, you attempted to specify UNIQUE or PRIMARY on a column, named nnnnnn, that was defined as allowing NULLs.

The SQLSTATE that equates to this SQL return code is 42831.

User Response

For CREATE TABLE, add NOT NULL to the column definition. For ALTER TABLE, change the UNIQUE or PRIMARY definition.