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 -> Modifying a constraint to make exceptions...

Modifying a constraint to make exceptions...

From: A Rangers Fan <bluenose_at_nowayjose.com>
Date: Wed, 12 Jan 2005 09:38:36 -0700
Message-ID: <41e55292_5@news3.es.net>


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

Original text of this message

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