db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John English <john.fore...@gmail.com>
Subject Re: How to drop two interrelated tables at the same time?
Date Sat, 11 Feb 2012 10:50:48 GMT
On 10/02/2012 14:49, Libor Jelinek wrote:
> Right, John. Because these two tables reference each other with FK
> constraints thus one column must allow null. Then it's application
> logic's responsibility to ensure that immediately when referenced row
> from second table is created it is set in first table (i.e. not leaving
> it null).

OK. I just seem to remember that some DBMSs allow a single insert to
multiple tables, or inserts to views, which *might* overcome this.

OTOH, if you're trying to achieve a strict 1:1 relation, couldn't you
merge the two tables into one (i.e. instead of table T1 having columns
A, B, C where A is the PK and B is FK to T2, and T2 has B, A, D, have
T with A,B,C,D)? Or again, am I missing something?

------------------------------------------------------------------------
  John English | My old University of Brighton home page is still here:
               | http://www.cem.brighton.ac.uk/staff/je/
------------------------------------------------------------------------

Mime
View raw message