Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: triggers -- distinguish between bulk and individual changes
You could do something like:
Pre-statement trigger - clear an array
declared in a package.
Pre-row trigger - write some information into the array that identifies the row.
Post-statement - check the number of
items in the array, and write audit
records as appropriate.
This is just a minor variation of the
method usually used to circumvent
the 'mutating table' problem if you
want to search the web for more
details.
-- Jonathan Lewis Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk Practical Oracle 8i: Building Efficient Databases Publishers: Addison-Wesley Reviews at: http://www.jlcomp.demon.co.uk/book_rev.html dportnoy wrote in message <3458aca6.0105211333.14a56b15_at_posting.google.com>...Received on Tue May 22 2001 - 17:03:27 CDT
>I am trying to create audit routines in which bulk data changes to the
>entire table are logged only once, while logging each manual change to
>individual records. So I think I need to figure out any of the
>following:
>
> * From within a row-level trigger, is there any way to identify
>whether other rows are being affected by the same SQL statement?
>
> * From within a statement-level trigger, is there any way to determe
>how many rows are being affected?
>
> * From within a statement-level trigger, is there any way to determe
>the SQL statement being run?
>
>Thanks.