SOLVED

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

Asked by OracleDba17 viewsoracle
1
2
3
4
5
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

Fix /
#oracle#error

Solutions(1)

Accepted Solution
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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) ;
OracleDba

Post Your Solution