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: Unique Constraint Error when Altering a Table

Re: Unique Constraint Error when Altering a Table

From: Tomm Carr <carr%tw_at_edwards.af.mil>
Date: 1997/09/04
Message-ID: <340EA8A6.7305@edwards.af.mil>#1/1

Dante A. Notari-Locher wrote:

>
 

> This sounds logic, when you concider, that the DEFAULT-value is
 

> only used (NULL replaced by the value definied in the
 

> DEFAULT-Clause) withDML-Statements. ALTER TABLE is DDL, so the
 

> DEFAULT-value is ignored and ORACLE tries to set column
 

> to NULL !

If you think about it, although Oracle will allow it, there is really no

reason to create a column with both a DEFAULT *and* NOT NULL. DEFAULT specifies what value to use if a row is inserted with a null for the column
and the NOT NULL says to never allow a null value for the column. The DEFAULT value will never be used!

-- 

Tomm Carr

tommcatt@computer.org -- http://www.geocities.com/athens/delphi/6769

-- The Macintosh computer is like the open range;

-- In a world without fences, there are no Gates.
Received on Thu Sep 04 1997 - 00:00:00 CDT

Original text of this message

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