Subject | Re: [firebird-support] Prevent direct update from view |
---|---|
Author | Dmitry Yemanov |
Post date | 2005-06-07T04:35:40Z |
"Kevin Day Programming" <kev.kdp@...> wrote:
natively updatable view (i.e. the one without distinct / aggregates / joins)
with triggers became a subject of the automatic direct underlying table
update performed by the engine. The original behaviour has been reverted
back in FB 2.0.
RDB$DATABASE.
Dmitry
>It has been changed during the Borland era, but kept undocumented. A
> > Lets say I have view V1(RowX) (select RowX from TableX);
> > If I am updating RowX in view V1, it updates that row in table as well.
> > How can I prevent it ? (I need to fire my own trigger on view, but it
> > updates table, then fires triger)
>
> Interesting question.
>
> I haven't ever put triggers on views although I know you can. The ibv6
> manuals suggest it as a method of making a non-updatable view updatable.
natively updatable view (i.e. the one without distinct / aggregates / joins)
with triggers became a subject of the automatic direct underlying table
update performed by the engine. The original behaviour has been reverted
back in FB 2.0.
> I guess you have to make your view non-updatable to begin with so that theCorrect. Generally, people work around this "feature" using a join with
> updating can be done with your triggers. Maybe you can put a join to
> another table or something like that. Views based on multiple tables are
> not updatable.
RDB$DATABASE.
Dmitry