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 -> how to call external exe from Database Trigger

how to call external exe from Database Trigger

From: <rushikesh.joshi_at_gmail.com>
Date: 29 Mar 2006 03:36:37 -0800
Message-ID: <1143632197.419095.107480@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

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:36:37 CST

Original text of this message

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