Blog
Learnomate Technologies > Blog > Oracle DBA > ORA-01442: column to be modified to NOT NULL is already NOT NULL
ORA-01442: column to be modified to NOT NULL is already NOT NULL
- November 2, 2021
- Posted by: Ankush Thavali
- Category: Oracle DBA
No Comments
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) ;
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) ;