How to add not null column to an existing table?
I have a table with hundreds of row in it. I am trying to add a new column with not null. It is giving me the following error
ALTER TABLE sys.xyz MODIFY xyz_no NUMBER(4) DEFAULT '1' NOT NULL;
ORA-02296: cannot enable (sys.) - null values found
Also i tried to do the following
ALTER TABLE sys.xyz MODIFY xyz_no NUMBER(4) DEFAULT '1';
And then i tried to ALTER TABLE sys.xyz MODIFY xyz_NO NUMBER(4) NOT NULL; and still i gave me the same error. I took the count for the null values for the same column and found it has 1555.
In this scenario how do i modify my column with not null ?. Please help i am a newbie to oracle.