Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: triggers on a group of records : DIFFICULT
Solomon.Yakobson_at_entex.com wrote:
>All you need is a statement level trigger. Statement level trigger
>is executed before or after the whole statement, versus row level
>trigger which is executed before or after every row involved in
>the statement. Therefore statement level trigger is never causing
>"mutating" state.
This is indeed a solution to prevent applications from inserting rows
which sum is not zero.
However, I can not agree fully with this solution.
The thing is that I have also forms working on this table, and there
the user puts in his records, record by record. I have also
application who read files and for every line inserts records, again
record by record. So after the insert statement, when the consistency
is not met, this is actually not an error (as long as it doesn't
commit). It can happen that a little bit later the other record is
inserted with an other insert statement, causing the database to be
consistent again.
What u actually need is a kind of pre-commit trigger or pre-exit trigger which can rollback the records if the consistency is not met. But as far as I know, there are no such triggers on database level. And I have no information that this is going to be implemented.
Thx for the info, anyway.
Peter.
PS : also thx to Thomas K. Received on Mon Jan 13 1997 - 00:00:00 CST