Home » SQL & PL/SQL » SQL & PL/SQL » Automatic Triggers
Automatic Triggers [message #204361] Mon, 20 November 2006 05:50 Go to next message
mudalimuthu
Messages: 64
Registered: May 2005
Location: Bangalore
Member
I want to execute one trigger automatically after updating one table delayed by 59 seconds.

say I am updating table t1
after 59 second i want to excecute trig1

is it possible?

regards
Muthu
Re: Automatic Triggers [message #204370 is a reply to message #204361] Mon, 20 November 2006 06:26 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Yes, sort of.

If you want the code in the trigger to have the option of rolling back the Insert, then No, you can't do it.

You could create a trigger that would create a DBMS_JOB that would run at approximately 1 minute from now, and get this job to do the work that you want, but it will be executing in a completely different session, and will know nothing about the statment that triggered it.
Re: Automatic Triggers [message #204596 is a reply to message #204361] Tue, 21 November 2006 06:21 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
What are you trying to achieve with that. Maybe you can get that in another way you didn't think of.
I for me cannot think of a logical need for this.
Re: Automatic Triggers [message #204647 is a reply to message #204596] Tue, 21 November 2006 08:48 Go to previous messageGo to next message
MarcL
Messages: 455
Registered: November 2006
Location: Connecticut, USA
Senior Member
The business case would be interesting to hear.

But I believe you can use a dbms_lock.sleep(59) which would hold the procedure for 59 seconds. But again, why would you ever want to do this ?

Marc

[Updated on: Tue, 21 November 2006 08:48]

Report message to a moderator

Re: Automatic Triggers [message #204765 is a reply to message #204647] Wed, 22 November 2006 00:42 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
I thought of the sleep as well. Downside is it holds the complete DML-process for a minute!
Previous Topic: GLOBAL TEMPORARY TABLES
Next Topic: unable to create a c function to use in plsql
Goto Forum:
  


Current Time: Tue Dec 03 12:16:36 CST 2024