Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: calling an external program from pl/sql

Re: calling an external program from pl/sql

From: Martin Drautzburg <drautzburg_at_altavista.net>
Date: 11 Apr 2001 03:29:40 +0200
Message-ID: <87u23wkyuz.fsf@altavista.net>

"R. Wiesner" <rwi_at_exmail.de> writes:

> Is it possible to make an external call of a program from a
> pl/sql-procedure or function (like the command host in sql*plus)? I'd
> like to call mailx or sendmail to send an email to the DBA. How could
> it be done? How can I give parameters to the external program?

I would like to know this myself. But because I dont't and I don't know anybode else who knows, let me tell you what we did to solve those kind of issues.

You create a separate process that does all the OS related stuff. You may call this process an OS-LISTENER. The server talks to this listener either via alerts or database pipes or both.

If you are in the lucky situation, to ride a unix or even a Linux system (I bet you are), you may consider sending a string that the OS-LISTENER will simply pass to a shell.

I/O-redirection will not be as in the real world, i.e. you cannot pipe things straight from the serer into the OS-LISTER, but maybe you can live without that. Things like (echo "something strange has happened, try to avoid" | mailx -s "Oracle alert" dba) should work though. Received on Tue Apr 10 2001 - 20:29:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US