Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Does ORACLE has any stupid restrictions like MS-SQL
Steve Phelan <stevep_at_pmcgettigan.demon.co.uk> wrote:
>For instance, changing a column from, say, NULL to NOT NULL is OK, but
>going the other way - well, you'd have to empty the table first.
Why on earth would Oracle, or any database for that matter, impose such a restriction? As it happens, Oracle does not. It is perfectly OK to change a column from NOT NULL to NULL, or vice versa. Of course, before you impose the NOT NULL restriction you do have to make sure that the column has values in all rows, just as before you create a unique index you have to make sure that the columns you specify are in fact unique!
To change the NULL restriction on a column, just do:
alter table xxx modify (yyy not null);
or:
alter table xxx modify (yyy with null);
-- Zev Sero Don't blame me, I voted for Harry Browne zsero@idt.net For more info, see http://www.lp.orgReceived on Wed Mar 19 1997 - 00:00:00 CST
![]() |
![]() |