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 Fri, 10 Feb 2012 10:51:29 GMT
On 10/02/2012 02:22, Bergquist, Brett wrote:
> Use
>
> alter table business_objects drop constraint fk_created_by;;
> alter table users drop constraint fk_boid;
> drop table business objects;
> drop table users;
>
> Basically reverse what you did to create the tables.
>
> Brett

As a matter of interest, how would you ever insert data into these two
tables? Inserting into either one would violate the FK constraint in
the other, unless the FK allowed nulls -- in which case you do an insert
with a null key into one table, an insert with non-null into the other,
and then an update of the first table's FK. Or 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