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 -> Re: Constraint

Re: Constraint

From: damorgan <damorgan_at_exesolutions.com>
Date: Mon, 01 Apr 2002 16:41:41 GMT
Message-ID: <3CA88DCB.5DDAF081@exesolutions.com>


You can't. There must be a point after which you create the team that there are no players. Then there is one, then two, etc. And there is no known constraint mechanism that will tell you when you have reached 12 and now allow you to enter the 13th.

You need to look at a BEFORE INSERT trigger to stop you from entering the 13th player. And you need to reconcile yourself to how you are going to enter the first four.

Daniel Morgan

Alan Galvin wrote:

> Suppose I have 2 tables:
>
> Team[TeamID(pk), coach, rating]
> Player[PlayerID(pk), TeamID(fk)]
>
> How do create a SQL such that a team can only have between 5 and 12 players?
>
> Thanks in advance.
Received on Mon Apr 01 2002 - 10:41:41 CST

Original text of this message

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