Help with Oracle constrant on two tables problem

From: <jharbour7_at_googlemail.com>
Date: Sat, 16 Feb 2008 06:17:16 -0800 (PST)
Message-ID: <438d587f-cc87-47e0-8dcd-3625f97b6543@o77g2000hsf.googlegroups.com>

This is my first post to Google groups. I am write with a new program I am writing using Oracle XE on Windows XP home.

Here it is.

I have a table called "table1" that has the following in it

id1     checkCount
 1         4
 2         5
 3         10
 6         14
 9         5


"table2" has the following

id1      Description
 1       id1description1
 1       id1description2
 1       id1description3
 1       id1description4
 2       id2description1
 2       id2description2
 2       id2description3
 2       id2description4
 2       id2description5

checkCount is the number of rows in "table2" that must have the same id1 (there are 4 rows with id1's with value 1, there are 5 rows with id1's with value 2 as in "table1")

I need to guarentee applications don't write to "table2" with an incorrect number of rows (for example to write 1, 2, 3, 5, 6, 7, 8, etc number of rows with id1. it should have 4 rows and always 4).

Can this be done with oracle XE with constrants?

Thank you

Jon Received on Sat Feb 16 2008 - 08:17:16 CST

Original text of this message