Subject | RE: [firebird-support] Re: Creating a view that relies on another view... possible? |
---|---|
Author | Alan McDonald |
Post date | 2004-12-12T22:37:57Z |
> Just a warning on doing this:If you use a tool like IBExpert, all this is done for you. IBExpert will
>
> We had a similar situation where we had a view that made a list of
> employees with a specific setting. We then made a view for a report we
> were writing that used that first view.
>
> The need then arose to add an extra condition to the where clause of
> the first view. As there is no way to "alter view", you have to drop
> and create the view, but, and here is where it gets messy, you are not
> allowed to drop the view without first dropping every stored
> procedure, trigger, and other view that relies on it, and of course
> those views can't be dropped unless nothing relies on them.
>
> To add one line of code to the first view, we would have had to drop
> about 15 views, and temporarily alter about 5 stored procedures and
> triggers.
>
> You may want to consider using a stored procedure in place of the
> view, and that way you can always alter it later without this sort of
> nonesense.
>
> Adam
create a script to drop all dependent objects, then create the new object,
then re-create all these dependent objects again. It's all done in just one
button click.
Alan