Re: Database trigger to start C program???
From: Tony Rothwell <Tony_at_santen.demon.co.uk>
Date: Tue, 28 Mar 1995 23:42:47 +0000
Message-ID: <774691754wnr_at_santen.demon.co.uk>
> I need to develop an 'event-based' PRO*C program which will be started
> on a particular database event. Can I use Database triggers to call
> a PRO*C program? Is this possible? I also read about an Oracel
Database
> package which supposedly allows for signals to be created. Are these
signals
> able to be 'handled' by PRO*C programs? This is being developed
> on a Unix machine. Any suggestions are appreciated!
Date: Tue, 28 Mar 1995 23:42:47 +0000
Message-ID: <774691754wnr_at_santen.demon.co.uk>
In article: <mlmorin.17.000E6E59_at_primenet.com> mlmorin_at_primenet.com (Michelle Morin) writes:
>
> I need to develop an 'event-based' PRO*C program which will be started
> on a particular database event. Can I use Database triggers to call
> a PRO*C program? Is this possible? I also read about an Oracel
Database
> package which supposedly allows for signals to be created. Are these
signals
> able to be 'handled' by PRO*C programs? This is being developed
> on a Unix machine. Any suggestions are appreciated!
Currently it's not possible to call external functions (eg C) from PL/SQL. The normal solution to your problem is to use either the dbms_pipe or dbms_alert packages, depending on whether you're dealing with transactional events (use alerts) or just trying to communicate between sessions (use pipes).
Basically, your Pro*C program waits on a pipe or an alert, and your database trigger sends a message on the pipe or signals the alert when it fires.
Good examples of both can be found in the dbmspipe.sql & dbmsalrt.sql package creation scripts in $ORACLE_HOME/rdbms/admin.
-Tony. Received on Wed Mar 29 1995 - 01:42:47 CEST