Home » SQL & PL/SQL » SQL & PL/SQL » Deferred trigger?
Deferred trigger? [message #37091] Wed, 16 January 2002 20:50 Go to next message
Dmitri Lipodat
Messages: 8
Registered: January 2002
Junior Member
Can I create in Oracle something like subj. I want to execute some procedure in the same session after every table update/insert or delete (like trigger), but only after changes is committed. Alerts is not good for it because I need one extra session for waiting them.
Re: Deferred trigger? [message #37101 is a reply to message #37091] Thu, 17 January 2002 12:05 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
As long as what you want the trigger to do is transactional (not like sending an email or using DDL or dbms_pipe etc) then it shouldn't be necessary to defer it - unless you want to hide the effects of the trigger from your current session which fires the trigger. The results of the trigger wouldn't be visible to other users until your commit too place. A rollback would obviously undo the trugger actions too (as long as they are transactional like DML).

There is a "when logoff" trigger in 8i which is the closest I can think of.
Re: Deferred trigger? [message #37106 is a reply to message #37091] Thu, 17 January 2002 21:08 Go to previous messageGo to next message
Dmitri Lipodat
Messages: 8
Registered: January 2002
Junior Member
Thx for your answer, but I know how standard triggers work, and I know about transactions. And I also understand, that alerts done by writing some records into system table, but real send of alert occur only when you commit the transaction. I want to make similar mechanism, but in result it will do some action and will not send alert.
DBMS_ALERT is a package, it is written by Oracle, but may be someone know how to create something similar.
Re: Deferred trigger? [message #37166 is a reply to message #37091] Tue, 22 January 2002 00:09 Go to previous messageGo to next message
dinakar shetty
Messages: 29
Registered: January 2002
Junior Member
Hi
U can use DBMS_JOBS
u can submit a job from the triggers
Re: Deferred trigger? [message #37181 is a reply to message #37091] Tue, 22 January 2002 21:38 Go to previous message
Dmitri Lipodat
Messages: 8
Registered: January 2002
Junior Member
May be. I didn't use this package before. But as I understand it will do actions in separate session. How I can wait for this job completion?
Previous Topic: Re: trigger trouble
Next Topic: dynamic sql problem
Goto Forum:
  


Current Time: Tue Apr 23 07:41:35 CDT 2024