Blog

ORA-01442: column to be modified to NOT NULL is already NOT NULL

Fix / Solution : ORA-01442: column to be modified to NOT NULL is already NOT NULL

When you fire below command, then following error will come If a column having no null values at all in a table. then you can’t add directly ‘NOT NULL’. You can follow below method to add NOT NULL constraint

sql> alter table HR.ADDRESSDETAILS modify UID not null;

ORA-01442: column to be modified to NOT NULL is already NOT NULL

Solution:

Syntax:

ALTER TABLE table_name ADD CONSTRAINT constraint_name CHECK(COLUMN_NAME IS NOT NULL);

Example:

ALTER TABLE HR.ADDRESSDETAILS  ADD CONSTRAINT nn_uid_hr_addrsdtls CHECK(UID IS NOT NULL) ;

Follow me

Contact us for Training/ Job Support

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.