Sam Joseph wrote:
> 
> On the Mckoi side - what happens if two tables have foreign key
> relations to each other - can they never be dropped?
> 

Sam,

In Mckoi, the DROP TABLE query accepts multiple tables so you can use
that to drop tables that reference each other.  For example,

  create table t1 ( pk integer, fk integer, primary key ( pk ) );
  create table t2 ( pk integer, fk integer, primary key ( pk ) );

  alter table t1 add foreign key ( fk ) references t2;
  alter table t2 add foreign key ( fk ) references t1;

  drop table t1;      <-- fails
  drop table t2;      <-- fails

  drop table t1, t2;  <-- works

I don't think this is a standard SQL feature however.  If you want
something that is more cross-DB compatible I would recommend using
Bernard's suggestion and dropping the foreign key constraints before
dropping the table.

Toby.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to