Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: triggers -- distinguish between bulk and individual changes

Re: triggers -- distinguish between bulk and individual changes

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Tue, 22 May 2001 23:03:27 +0100
Message-ID: <990570155.23295.0.nnrp-07.9e984b29@news.demon.co.uk>

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>...

>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.
Received on Tue May 22 2001 - 17:03:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US