Subject Re: [firebird-support] DROP CASCADE
Author Daniel Rail
Hi,

At June 18, 2004, 13:59, okeanospacifik wrote:

> I'm new with Firebird. I'm looking for the way to do a "DROP TABLE
> mytable CASCADE" to drop the table 'mytable' and all tables with
> constraints on this table. I can do this with mysql, oracle, maxdb,
> but when I try this with Firebird, I get an error, and I found nothing
> in the documentation about this.

It is not currently supported in Firebird. I checked with the SQL
standards, and DROP TABLE mytable CASCADE would not drop all the
tables with constraints to this one, but only drop the constraints
themselves.

According to the SQL standard, DROP TABLE mytable CASCADE would also
have to perform the following tasks:

DROP VIEW dependant_view CASCADE
ALTER TABLE dependant_table DROP CONSTRAINT dependant_constraint CASCADE
DROP TRIGGER dependant_trigger CASCADE
DROP STORED PROCEDURE dependant_sp CASCADE

> So if you have an idea, it will be great

You can query the system table RDB$DEPENDENCIES to get the
dependencies related to one table.

--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)