Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Q: how to drop NOT-NULL constraint on a column?!

Re: Q: how to drop NOT-NULL constraint on a column?!

From: Jomarlen <jomarlen_at_aol.com>
Date: 1997/11/28
Message-ID: <19971128185700.NAA08988@ladder01.news.aol.com>#1/1

Hi

Alter table my_tab
modify my_col NULL;

Alter table my_tab
modify my_col NOT NULL;

The first always works.
For the second to work ALL rows must have a not null value in the column.

Very sensibly you are not allowed to create a constraint if violations of that constraint exist.

John

>Hi all, a question on which I'm not finding a book answer -- used to be,
>that the only way to change a table column from NULL to NOT NULL, or
>back, was to export, drop the table, recreate it, and re-import.
>
>For Oracle 7.1 and above, is there an easier way? It seems to be the
>only table constraint one cannot drop.... TIA!
Received on Fri Nov 28 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US