Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Constraint problem: number of rows...
HansF wrote:
> On Mon, 13 Jun 2005 19:38:37 +0200, Volker Hetzer interested us by
> writing:
>
>
>>I've got a rather stupid constraint problem: >>There's a table with data on PCB symbols (like "7400" or "Resistor"). >>Per symbol there's the number of pins on the symbol. >>Now, another table is supposed to have as many rows (per symbol) >>as there are pins. >>Is there any way I can have a constraint checking this?
> If external, I suspect it's time to start looking at the triggers.
Hm. Yes, that could work. First insert the pins, then upon insertion
of the symbol the trigger checks. What happens if someone inserts a pin
row and does not update the pin count? Can I have a trigger fire at the
end of a transaction?
> It would be nice if 'Foreign Key' constraint lifted the 'match'
> restriction and allowed 'expression' instead. Then we could write
>
> CONSTRAINT match_and_range
> FOREIGN KEY (mycol, myref)
> REFERENCES reftab (mycol=fcol, myref<=fref);
Yes, wouldn't it?
Lots of Greetings and thanks!
Volker
Received on Mon Jun 13 2005 - 13:34:16 CDT
![]() |
![]() |