Re: triggers on views

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Mon, 01 Dec 2008 22:28:58 +0100
Message-ID: <49345719$0$189$e4fe514c@news.xs4all.nl>


Veganders schreef:
> Creating a database as a part of a school project, I ran into a
> problem that was solved by switching place of two rows that by the
> look of them would suggest their order would be irrelevant.
> The situation was roughly as follows:
> A view was created as a union of two tables.
> Two "instead of" trigger was created to handle insert and deletes on
> the view
> In the delete trigger, if the row to be deleted is in the first of the
> two tables, a row from the second table is deleted and then inserted
> into the first one. It was the two lines to move the row from the
> second table to the first that caused to problem. In one of the cases,
> the row was just inserted into the first table, but never removed from
> the second.
> Trying to find a reason for this, the only thing I came up with, that
> could explain this odd behaviour, is that a trigger on a view will be
> executed not only on insertion or deletion on the view itself, but
> also on its underlying tables. Is this a correct assumption or is my
> error someplace else?
>
> Best regards
> Anders

Anders,

I don't think your assumption is correct, but if you post your code, we can always check...

Shakespeare Received on Mon Dec 01 2008 - 15:28:58 CST

Original text of this message