Re: Call C program within a trigger?
Date: 2 Dec 1994 22:31:13 GMT
Message-ID: <3bo77h$9s3_at_raffles.technet.sg>
Li J. Cheng (lcheng_at_astro.ocis.temple.edu) wrote:
: Hi, everybody there:
: We are running Oracle server 7.0 on a RS6000 box, I want to
: know is it possible to run a C program within a triggerr? e.g,
: when user place an order, I want to activate a C program to
: send the order information to our Tandem machine(Which is not
: running any SQL database). If it is not possible to use trigger
: to do this, is there any other way to do this?
: Any help will be greatly appreciated, I will post a summary if
: enough people interested, please email me at lcheng_at_astro.ocis.
: temple.edu .
Oracle has several features that allow Oracle stored procedures to communicate with C programs.
- You can fork out the C program within the stored procedure.
The disadvantage here seems to be that the code will run your C program even before the commit so if an error happens later on in the transaction and u rollback, the C program will still have been activated anyway. This could be undesirable.
2. Look thru Oracle Application Developers' Guide for DBMS_PIPE.
DBMS_PIPE is a set of functions/procedures that u can call in stored procedures/triggers. You send a message eg. string via DBMS_PIPE and then use a ESQLC program (could be a daemon) to receive the message via DBMS_PIPE calls. This ESQL/C program can then use sockets to transfer data to the TANDEM.
Disadvantage: As in point 1.
Advantage over point 1: No forking. Less resource intensive if
you have a few 100 users calling this feature at once...
3. Use DBMS_ALERT. This is another set of functions/procedures.
They are transaction based and have the power of DBMS_PIPE.
Hope this helps. Received on Fri Dec 02 1994 - 23:31:13 CET