Two Laptop Bag
The moose likes JDBC and Relational Databases and the fly likes CONSTRAINT clause help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "CONSTRAINT clause help" Watch "CONSTRAINT clause help" New topic

CONSTRAINT clause help

Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

I am trying to create a table that has a couple of unique fields like so

Where containableGraphics is another table with the fields ID and ParentID. I am trying to say that Position(s) are UNIQUE with respect to each Parent. But I don't think this type of constraint will work. I can always do this;

But I didnt want to redundantly enter the ContainerID when this info is also referred to by the containableGraphics ID since a containableGraphics can have only 1 parent which is a containerGraphics.
Any ideas on this??
I agree. Here's the link:
subject: CONSTRAINT clause help
It's not a secret anymore!