Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can C programs be invoked from triggers?

45 views
Skip to first unread message

Ariel Zach

unread,
Oct 17, 1994, 12:49:44 PM10/17/94
to
Amir Kessner, Log-On

Ariel Zach

unread,
Oct 18, 1994, 3:05:16 AM10/18/94
to

Jason Lisenchuk

unread,
Oct 18, 1994, 11:42:24 AM10/18/94
to
Can C programs be invoked from triggers?

Not directly. However, you may use DBMS pipes within any PL/SQL block to
output arbitrary text to a stream. You may then develop a Pro*C program
to run as a listener daemon and fork other Pro*C programs based on its
interpretation of the input stream.

Barberl

unread,
Oct 18, 1994, 2:45:19 PM10/18/94
to
In article <CxttE...@actcom.co.il>, lo...@actcom.co.il (Ariel Zach)
writes:

These days, you need a better description of what triggers. Here goes:

Database triggers: Must communicate to another running process via dbms
pipe. That process would launch your C program.
Forms Triggers: User exits or HOST call. Also could use the dbms pipe as
above.

George Svedloff

unread,
Oct 18, 1994, 5:14:29 PM10/18/94
to
This is a very good question that I have been trying to find an answer to for some
time. If anybody knows anything about this, it will be greatly appreciated.

John Morgan

unread,
Oct 19, 1994, 12:02:46 PM10/19/94
to
In article <381drl$6...@ixnews1.ix.netcom.com> George Svedloff,

Yes...you must use the DBMS_PIPES (v7). Create a stored procedure that
the trigger executes. The procedure then places a set of code on a named
pipe. The C program is "listening" to this pipe for instructions. I use
it to pass UNIX system commands out to be executed.

dh...@us.oracle.com

unread,
Oct 19, 1994, 12:33:06 PM10/19/94
to

There is a product called Oracle Plex that is supossed to enable triggers
to execute programs external to Oracle (I'm not very familiar with it). I
do not know if this product is in production; I would suggest that you
contact an Oracle sales rep and ask them to get more info on this product
(they may not be aware of it either).

Thomas J Kyte

unread,
Oct 19, 1994, 2:25:22 PM10/19/94
to
dh...@us.oracle.com writes:

Yes, there is a product called PLEX (not Oracle PLEX) that does just this.
It fully automates the creation of pipes-based application servers that,
in short, let you call any user written 3GL functions from within Oracle7
stored procedures (and hence triggers).

Note that PLEX is not a product of Oracle Corporation but was developed
by Oracle Government employees and is now available for general distribution.

For more detailed information please email a request to either
tk...@us.oracle.com or thoe...@us.oracle.com


Jonathan Wayne Ingram

unread,
Oct 19, 1994, 9:53:19 PM10/19/94
to
John Morgan (John_...@OIT.PeachNet.EDU) wrote:
: In article <381drl$6...@ixnews1.ix.netcom.com> George Svedloff,

I am not sure you got the question quite right -- he asked if he could call
a c program, not communicate with one. As to calling, the answer is no
when you refer to database triggers. But the above mentioned solution
will work if you want ot have your c program loop infinitely and check
the pipe each time through the loop :)

Hopefully the next release of PL/SQL will have a host capability.
Also, better signalling would be nice.

Jonathan, who prays for better Oracle every day :)

George

unread,
Oct 20, 1994, 8:32:09 AM10/20/94
to
Why not use the dbms alert package that is supplied with oracle. This will
not cost anything else and is alot easier to implement than using pipes
directly. The dbms apckage is found in rdbms/admin. You need to develop
a trigger that activates the c 'daemon' that has registered itself with
the dbms_alert_info table. Works like a charm, this is what I use :)

Joe Halpin

unread,
Oct 20, 1994, 5:20:08 PM10/20/94
to
In article <384iif$m...@server.st.usm.edu> jwin...@whale.st.usm.edu (Jonathan Wayne Ingram) writes:
>I am not sure you got the question quite right -- he asked if he could call
>a c program, not communicate with one. As to calling, the answer is no
>when you refer to database triggers. But the above mentioned solution
>will work if you want ot have your c program loop infinitely and check
>the pipe each time through the loop :)

Well, it's not all that bad. If you do a blocking read in the loop the C
program will be asleep, and therefore not using the processor, until it
needs it.

--
Joe Halpin
jha...@netcom.com
---------------------------------------------------------------------------

Kjartan Gudmundsson

unread,
Oct 20, 1994, 8:03:24 PM10/20/94
to
In <384iif$m...@server.st.usm.edu> jwin...@whale.st.usm.edu (Jonathan Wayne Ingram) writes:

>I am not sure you got the question quite right -- he asked if he could call
>a c program, not communicate with one. As to calling, the answer is no
>when you refer to database triggers. But the above mentioned solution
>will work if you want ot have your c program loop infinitely and check
>the pipe each time through the loop :)

This sounds like the C prorgram will be in a busy loop testing for a
new message on the pipe. This is not so, after the pipe process has
issued the "recieve_message" command it goes to sleep until a message
comes down the pipe.

krg.

0 new messages