Operating System - HP-UX
1752505 Members
5514 Online
108788 Solutions
New Discussion юеВ

Re: can I use Oracle trigger to execute other program?

 
SOLVED
Go to solution
xiongye_2
Occasional Advisor

can I use Oracle trigger to execute other program?

Hi: all, Can I execute other program(Tuxedo or java ) in Oracle trigger ? Thanks !!!
xysco
3 REPLIES 3
Steven Gillard_2
Honored Contributor

Re: can I use Oracle trigger to execute other program?

As of Oracle 8i its possible to write stored procedures (including triggers) in java. The following is the java stored procedure development guide:

http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a81358/toc.htm

Regards,
Steve
Tom Geudens
Honored Contributor
Solution

Re: can I use Oracle trigger to execute other program?

Hi,
Yes you can ...
Take a look at the following thread (where I answered a similar question :-) :
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xcac1a2db8513d6118ff40090279cd0f9,00.html

Regards,
Tom Geudens
A life ? Cool ! Where can I download one of those from ?
Ryan Kogelheide
Frequent Advisor

Re: can I use Oracle trigger to execute other program?

Tom's answer is correct, but the way we did it before external proc calls was to write our own "listener" in an external process that connects to the database and listens on a DBMS_PIPE.

Other stored procedures or triggers can then send to the DBMS_PIPE.

There is an example of the listener in C in the Supplied PL/SQL Packages Reference under DBMS_PIPE examples.

If you're concerned about the security problems that Tom mentioned (I've never looked...) then consider the DBMS_PIPE solution.

Also, if you want to do something simple like send a mail or a simple TCP call, there are the supplied PL/SQL packages UTL_SMTP and UTL_TCP that work if you have the JServer component installed.

Good luck.

Ryan