Re: Database trigger to start C program???
From: Tony Ohara <ohara_at_apollo.csu.murdoch.edu.au>
Date: 29 Mar 1995 05:38:39 GMT
Message-ID: <3larovINN11f_at_newsman.murdoch.edu.au>
Date: 29 Mar 1995 05:38:39 GMT
Message-ID: <3larovINN11f_at_newsman.murdoch.edu.au>
Hi Michelle,
We had to do a similar thing here at Murdoch Uni.
The Oracle database package you want is called dbms_alert. I had to "grant execute on dbms_alert to public" to make it available to the application owners (we have three apps all using the package in our database).
A trigger generates an alert such as:
dbms_alert.signal('YOUR_ALERT_NAME',to_char(:new.alert_no));
The pro*c program then waits for an alert of that name and does whatever processing is required:
dbms_alert.register('YOUR_ALERT_NAME'); dbms_alert.waitone ('YOUR_ALERT_NAME', p_message, p_status, 3000000);
These parameters are described in the Oracle 7 Server Application Developers Guide.
The Pro*C program I wrote is run as a UNIX daemon.
Hope this helps.
- Tony O'Hara