Re: triggers on views
Date: Thu, 11 Dec 2008 17:25:24 -0800
> 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
And you have determined that there are no foreign key constraints defined? <g>
-- Daniel A. Morgan Oracle Ace Director & Instructor University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Thu Dec 11 2008 - 19:25:24 CST