Subject | Re: [firebird-support] Alter views with dependencies |
---|---|
Author | Martijn Tonies |
Post date | 2005-03-11T08:19:13Z |
Robert,
1) drop all dependent views, drop your view and recreate everything
2) re-route the dependencies, drop your view, re-establish the dependencies
Method (2) requires some system-table updating and isn't officially
supported.
In co-op with Arno, who does a fair bit of Firebird work ;-), I researched
this method and it seems to work fine, as long as you don't remove any
column that other views depend on. This method is used by Database
Workbench, a tool I developed. Download your trial at www.upscene.com
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com
> One big problem with views is that you can not alter a view if thereThere are two ways to do this -
> are other views dependent on it.
> You have to drop all dependent views (and views that are dependent on
> the dependent views, etc), then alter the main view and create all
> dependent views again.
>
> Is there a tool to do this automatically?
1) drop all dependent views, drop your view and recreate everything
2) re-route the dependencies, drop your view, re-establish the dependencies
Method (2) requires some system-table updating and isn't officially
supported.
In co-op with Arno, who does a fair bit of Firebird work ;-), I researched
this method and it seems to work fine, as long as you don't remove any
column that other views depend on. This method is used by Database
Workbench, a tool I developed. Download your trial at www.upscene.com
> Or even better: are there plans to support the alteration of viewsWith regards,
> with dependecies?
> I have already seen a Request for Enhancement/Feature for this in the
> tracker (#807979), but it seems very old and forgotten.
>
> In most cases the dependencies after the alteration of the view are
> the same as before the alteration (f.e. in case I only change the
> where clause or add fields to the select clause). So maybe it is
> hopefully:) not too difficult to change Firebird to support this
> cases.
>
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com