Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a NULLable column to NOT NULL in oracle

How to make a NULLable column (varchar2(20)) to NOT NULL of a table in oracle where I have more than 1 million records in the table

like image 431
user2202664 Avatar asked Sep 07 '25 00:09

user2202664


1 Answers

NOT NULL constraint specifies that a column cannot contain NULL values. To add a NOT NULL constraint to an existing table by using the ALTER TABLE statement.

ALTER TABLE table_name MODIFY ( column_name NOT NULL);

In this case, the column_name must not contain any NULL value before applying the NOT NULL constraint.

like image 95
Lalit Kumar B Avatar answered Sep 09 '25 17:09

Lalit Kumar B