Adsense Ad

Wednesday, 24 May 2017

Oracle: ORA-01442 Error Message

ORA-01442 Error Message

Learn the cause and how to resolve the ORA-01442 error message in Oracle.

Description

When you encounter an ORA-01442 error, the following error message will appear:
  • ORA-01442: column to be modified to NOT NULL is already NOT NULL

Cause

You tried to execute a ALTER TABLE MODIFY statement to change a column to NOT NULL, but the column is already set to NOT NULL.

Resolution

The option(s) to resolve this Oracle error are:

Option #1

The ALTER TABLE statement is unnecessary since your column is already set to NOT NULL.
For example, if you had a table called suppliers defined as follows:
CREATE TABLE suppliers
( supplier_id number(5) NOT NULL,
  supplier_name char(100)
);
And you tried to execute the following ALTER TABLE statement:
ALTER TABLE suppliers
 MODIFY supplier_id NOT NULL;
You would receive the following error message:
Oracle PLSQL
There is no remedy for this error since your table definition is identical to your ALTER TABLE statement.

No comments: