Oracle Null and Unique value
Hi Friends,
I have created a table with 2 fields such as name and rollno.
I specified rollno as unique constraint instead of not null constraint.
I have used the following query to change the unique as not null and get the following message.
Alter table student modify(rollno number(5) not null);
Table altered.
But it doesn't accept the not null concept and accepts only the unique concepts.Why? Can you just clarify my doubts?
Re: Oracle Null and Unique value
Did u verify before Altering the table taht there are no records in table with NULL RollNumbers?
Re: Oracle Null and Unique value
hi subhasini,
for
[I]But it doesn't accept the not null concept [/I]
sorry plz check it again it will definitly accept notnull if table alter succesfully.
for
[I]accepts only the unique concepts.Why?[/I]
see you have to drop the unique constraint on that column .
by
alter table student drop unique (rollno);
so that it will not accept contraints
hope u will get understand ..
from
sam
Re: Oracle Null and Unique value
If the table is altered successfully ,its bound to work.