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

Home -> Community -> Usenet -> c.d.o.server -> Re: triggers

Re: triggers

From: EdStevens <quetico_man_at_yahoo.com>
Date: 13 Feb 2006 12:41:51 -0800
Message-ID: <1139863311.725841.40760@g14g2000cwa.googlegroups.com>

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

Original text of this message

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