Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Unique Constraint Error when Altering a Table
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
![]() |
![]() |