Home » SQL & PL/SQL » SQL & PL/SQL » Trigger and event code.
Trigger and event code. [message #194189] Thu, 21 September 2006 02:35 Go to next message
Messages: 135
Registered: January 2004
Location: Beijing,China
Senior Member
As a developer of oracle and .net.
I want to find a method which could create a code event by oracle trigger.
For example, when there is a new record in a table , an event will be raised and the code in the OnEvent() could be executed.
So I do not have to create a thread for listening the table.
Re: Trigger and event code. [message #194254 is a reply to message #194189] Thu, 21 September 2006 05:35 Go to previous messageGo to next message
Messages: 201
Registered: August 2006
Location: Denmark
Senior Member
Do You want to call .Net from a trigger?

Do not think this is possible, at least not directly.
You can call pl/sql (packages+procedures), Java stored procedures and external C (using extproc).
You can also make external calls using utl_http, so if You put Your code on a application server?

Why not write the code in pl/sql instead?

Re: Trigger and event code. [message #194362 is a reply to message #194189] Thu, 21 September 2006 12:06 Go to previous message
Messages: 18
Registered: September 2006
Location: London
Junior Member
If you want to 'call out' from the database to .net code, there are a few solutions (however, note that it's always better to process everything in the database, if possible):

1. use UTL_HTTP to execute a http call from database and post required data

2. use a stored java procedure to send JMS/call out/do anything that java can do

3. store data in a database queue, and implement a blocking queue subscriber in .net

even in the first two cases, I strongly suggest inserting records into a database queue from the trigger and then asyncronously processing that data. Connecting to an external system directly from the trigger will have a significant performance impact on your data operations, and may cause additional errors (i.e. http server unavailable etc).

Gojko Adzic

Previous Topic: Check for Existance of Objects
Next Topic: Delta Refresh and Full Refresh?
Goto Forum:

Current Time: Fri Aug 18 22:40:59 CDT 2017

Total time taken to generate the page: 0.26736 seconds