Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: how to call external exe from Database Trigger
Hi
Try to avoid calling an external programs from triggers. If some error
occurs the transaction is still open amd may hurt the perfomance and lock
others to use the table
<rushikesh.joshi_at_gmail.com> wrote in message
news:1143632197.419095.107480_at_j33g2000cwa.googlegroups.com...
> Hi All,
>
> There is a measurement data which storing some measurement values.
>
> Now i want to write a trigger on this to achive following goal.
>
> insert in a history table if the measurement.DataValue is increase by
> some predefine value. also insert the time for this.
>
> update in the time in same table if the measurement.DataValue come to
> normal (i mean below that predefine value).
>
> And also want to fier some external exe file on first insert scenario
> (increase value)
>
> Below is my stuff, it's working fine. But i don't know how do i call
> external exe file to execute on specific condition.
>
> Thanks & Regards
> Rushikesh
>
>
> ---- Trigger---
>
> CREATE TRIGGER [Measurement_Insert] ON [dbo].[Measurement]
> FOR INSERT
> AS
>
> INSERT INTO Trigger_History(TriggerID, TriggerValue, StartTime)
> select Triggers.TriggerID, inserted.[Value], inserted.[DateTime] from
> inserted, Triggers
> Where
> Triggers.LocationID = inserted.LocationID
> AND inserted.Value >= Triggers.TriggerValue
>
> UPDATE Trigger_History SET EndTime = (Select inserted.[DateTime] from
> inserted)
> where Trigger_History.TriggerID
> IN( select t1.TriggerID from Triggers t1,inserted t2
> Where t1.LocationID = t2.LocationID
> AND t2.Value < t1.TriggerValue)
>
Received on Wed Mar 29 2006 - 05:51:55 CST
![]() |
![]() |