Subject | Re: [firebird-support] drop table XX cascade |
---|---|
Author | Martijn Tonies |
Post date | 2004-09-27T11:29:13Z |
> > Is the functionlaity CASCADE is supported in dropWhich is something different from the metadata CASCADE.
> > table.
> >
> > i.e. drop table <table_name> cascade
> >
> > Note : CASCADE in drop table will remove associated
> > child table constraints. (FK constraint)
>
> You have to define the constraint with the desired CASCADE action. If you
> then delete a master, the detail will be treated according to your
> constraint definition.
> Example:
> ALTER TABLE MyTableDetail ADD CONSTRAINT FK_TableMasterID FOREIGN KEY
> (DetailMasterID) REFERENCES MyTableMaster (ID) ON DELETE CASCADE;
>
> would delete the detail record if the master record was deleted.
No, "CASCADE" in DROP TABLE is not supported. You need
to drop FKs (or other constraints, procedures, triggers, views etc)
that use the table, yourself.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com