enforce no master without detail

From: steph <stephan0h_at_yahoo.de>
Date: Wed, 5 Aug 2009 01:50:39 -0700 (PDT)
Message-ID: <02429855-087d-44db-87f1-3cbb94a5a202_at_18g2000yqa.googlegroups.com>


I'm just wondering ...

what would be the most elegant way to enforce the rule "don't create a master without at least one detail"
having a master-table and a detail-table connected via 1:n relationship? The desired behaviour should be an error being raised when committing an insert on the master-table where no details exist (similarily deleting the details and leaving the master should raise an error).

stephan Received on Wed Aug 05 2009 - 03:50:39 CDT

Original text of this message