Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Modifying a constraint to make exceptions...
Just use a unique index...
SQL> CREATE TABLE TEST5 (C1 VARCHAR2(1)) 2 /
Table created.
SQL> CREATE UNIQUE INDEX TEST5_U1 ON TEST5(C1) 2 /
Index created.
SQL> INSERT INTO TEST5 VALUES (NULL)
2 /
1 row created.
SQL> INSERT INTO TEST5 VALUES (NULL)
2 /
1 row created.
SQL> INSERT INTO TEST5 VALUES ('a')
2 /
1 row created.
SQL> INSERT INTO TEST5 VALUES ('a')
2 /
INSERT INTO TEST5 VALUES ('a')
*
ERROR at line 1:
ORA-00001: unique constraint (SWPA.TEST5_U1) violated
Received on Wed Jan 12 2005 - 11:42:04 CST
![]() |
![]() |