Re: UNIX Triggers and PL/SQL Question

From: Chris Cummings <chrisc_at_netcom.com>
Date: Fri, 15 Apr 1994 13:57:11 GMT
Message-ID: <chriscCoB03C.wM_at_netcom.com>


Gary Meyers (dbsgrm_at_arco.com) wrote:
: Greetings,
: Is there a way for a Trigger to use an external C program? Explanation: A developer
: wants to write a Database trigger that will cause files to be created and operated
: on depending upon certain criteria.
 

: I know that you can't issue HOST commands from inside a PL/SQL block. Is there a way
: to invoke an external shell script from a trigger?
 

: User Exits ring a bell, but I'm not familiar with them yet.
 

: Thanks for the help.

: ---
: Gary Meyers : Usual disclaimer here
: gary.meyers_at_Edm.Arco.COM : My opinions, etc. etc.

Gary,

I don't know of any way for a database trigger to make operating system calls directly, but Oracle has provided a pair of stored packages that provide you a way to do it indirectly. Check out the dbms_pipe and dbms_alert packages. I believe you will find them in the Application Developers Guide.

These packages allow one Oracle session to send messages to another Oracle session. To do what you want you would have to have a Unix daemon that establishes a connection to Oracle and then waits for message to act upon. Your database trigger would send a message to the daemon, probably through dbms_alert, whenever an event occurs that requires work to be done at the operating system level. The daemon would receive the message, interpret its meaning, and perform the required task.

User exits, by the way, are part of Forms and are not available to database objects.

Good Luck,

Chris Cummings
Dallas Softworks Inc. Received on Fri Apr 15 1994 - 15:57:11 CEST

Original text of this message