I would like to know the syntax for putting a table constraint as follows:
Create Table tmp(id number, name varchar2(13));
How do I put a constraint if id =100 then name must be 'Peter' . I dont want to make use of triggers.
Thanks
Printable View
I would like to know the syntax for putting a table constraint as follows:
Create Table tmp(id number, name varchar2(13));
How do I put a constraint if id =100 then name must be 'Peter' . I dont want to make use of triggers.
Thanks
What kind of constraint are you talking about?
http://www.oradoc.com/ora816/server....eral.htm#12076
http://www.oradoc.com/ora816/appdev....05itg.htm#1309
Sam
AFAIK you cannot do that, a check constraint on 1 column cannot reference another one, and I don't see how you could use another type of constraint to do that ...