Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: triggers
DA Morgan wrote:
> extents wrote:
> > Hi
> > Is there a way to find out how many times a trigger has been fired
> > during a given time?
> >
> > ta
>
> CREATE TABLE trigger_audit (
> times_fired NUMBER,
> when_fired TIMESTAMP DEFAULT SYSTIMESTAMP);
>
> Alter your trigger to incude an update of the times_fired column.
> --
> Daniel A. Morgan
> http://www.psoug.org
> damorgan_at_x.washington.edu
> (replace x with u to respond)
Actually, unless the OP can make a more precise, and fixed, definition of "a given time" I'd think ....
CREATE TABEL trigger_audit (
when_fired TIMESTAMP DEFAULT SYSTIMESTAMP);
Alter your trigger to incude an INSERT on the trigger_audit table.
The, he could simply
SELECT COUNT(*)
FROM trigger_audit
WHERE when_fired BETWEEN .....
Now, if the trigger has various functions based on what it finds at run-time, he might want to add a column to indicate which function the trigger performed at the given timestamp. Received on Mon Feb 13 2006 - 14:41:51 CST