Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Unique Constraint Error when Altering a Table
NCR Employee wrote:
> ALTER TABLE table_name
> ADD
> (column VARCHAR(1) DEFAULT 'Y' NOT NULL);
>
> ERROR at line 1:
> ORA-00001: unique constraint (.) violated.
>
We are running into the same problem as yours.
We noticed that once you add a column and make it NOT NULL by using:
ALTER TABLE table_name ADD (newcol NUMBER);
UPDATE table_name SET newcol = 0;
ALTER TABLE table_name MODIFY (newcol DEFAULT 0 NOT NULL);
oracle no longer consider
ALTER TABLE table_name
ADD (newcol2 NUMBER DEFAULT 0 NOT NULL);
an error!
Is this a known issue of oracle?
Regards,
-Brian Received on Wed Sep 03 1997 - 00:00:00 CDT
![]() |
![]() |