Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Modifying a constraint to make exceptions...
Sorry for the poor subject header. I have a constraint e.g.
ALTER TABLE CAR ADD CONSTRAINT uniqueCar UNIQUE(make, model);
Is there anyway to modify the constraint to permit entries where the model is null i.e. allowing insertions of two similar makes?
E.g.
INSERT INTO car (make) VALUES ("honda"); INSERT INTO car (make) VALUES ("honda"); // SUCCESS
INSERT INTO car (make, model) VALUES ("honda", "civic"); INSERT INTO car (make, model) VALUES ("honda", "civic"); // FAILURE
Thanks in advance for any tips. Received on Wed Jan 12 2005 - 10:38:36 CST
![]() |
![]() |