Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger on several tables with time limit?
Read about dbms_job. In the trigger you create a job to run once at some
future time. There is no polling involved. The database will run that code
at the future time (eg 40 minutes from now) that you specify. In the code
you can have it do the update if it hasn't been done. I don't see what
polling has to do with it. Perhaps it isn't clear to my what you are trying
to accomplish.
Jim
-- Replace part of the email address: kennedy-down_with_spammers_at_attbi.com with family. Remove the negative part, keep the minus sign. You can figure it out. "M" <marvelan_at_hotmail.com> wrote in message news:c0abefc3.0302211056.11186871_at_posting.google.com...Received on Sat Feb 22 2003 - 02:36:20 CST
> Well... but the problem is that I cannot know how often to run
> the job.
>
> The value of the alarm is stored in a status column. If I poll the
> database too seldom I can miss that the valu has been set to "on"
> and then later on (before my job runs) back to "off" again...
>
> The server would die if I execute the job in a tight polling loop...
>
>
> "Jim Kennedy" <kennedy-downwithspammersfamily_at_attbi.com> wrote in message
news:<rIr5a.198905$HN5.851984_at_rwcrnsc51.ops.asp.att.net>...
> > Okay. Then the dbms_job package in the trigger should do it. You can
have
> > the job run at some future time eg 40 minutes.
> > Jim
> > "M" <marvelan_at_hotmail.com> wrote in message
> > news:c0abefc3.0302210010.1276c901_at_posting.google.com...
> > > Well, one reason I need this kind of features is alarm management.
> > >
> > > Let say some application writes alarms to the database. I would like
> > > to react to the fact that a alarm has been turned on and not turned
> > > off within a certain time limit, say three minutes.
> > >
> > > I really don't want to poll the databas all the time, hard to know how
> > > often to poll it to begin with.
> > >
> > >
> > > "Jim Kennedy" <kennedy-downwithspammersfamily_at_attbi.com> wrote in
message
> > news:<CI65a.189869$be.178124_at_rwcrnsc53>...
> > > > Never heard of it, don't know why you want it, but use dbms_job to
do it
> > for
> > > > you. Have an ordinary trigger create a dbms_job that will populate
the
> > 2nd
> > > > table x amount of time in the future.
> > > > Jim
> > > > "M" <marvelan_at_hotmail.com> wrote in message
> > > > news:c0abefc3.0302200726.59816251_at_posting.google.com...
> > > > > I thought of building a kind of super/multi trigger for Oracle and
> > > > > would like to get an second oppinion if it is a good idea. Or if
> > > > > there already exists good solutions for this...
> > > > >
> > > > >
> > > > > What I thought of doing is to build a stand alone server that can
> > > > > be used to define triggers on several tables. Lets say I want to
> > > > > trigger when:
> > > > >
> > > > > "(table1.value1 > 12) and (table2.value2 < table4.value4)"
> > > > >
> > > > > Not neccesarily using this made up syntax, or some other
> > > > > combination of changes in several tables.
> > > > >
> > > > > I also would like to have some kind of temporal capability, for
> > > > > example I would like to trigger on:
> > > > >
> > > > > "table1.value1 < 12 and (table2.value1 < 12 within one hour)"
> > > > >
> > > > > I also would like the changes in the table to be able to be apart
> > > > > from each other in time. So that first I wait for a change in one
> > > > > table and then, few hours later, a change in other table will
> > > > > trigger my super-trigger (or whatever it should be called)
> > > > >
> > > > > Am I inventing a wheel here? I have the need for this capability?
> > > > > What about you?
> > > > >
> > > > > Cheers
> > > > > /Marv