Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: pl/sql - os interaction
In article <36832922.0203111015.2ffd77fa_at_posting.google.com>, ninetyplus_at_aol.com
says...
>
>All,
>
>Does anyone know how to call a simple shell script from within PL/SQL.
> I am trying to create a trigger failure notification. I planned on
>using the inherent email ability of unix in a shell script combined
>with simple exception logic. I didn't know, that you can't call this
>script from within the PL/SQL code. I can't use Java, because of the
>Oracle version (8.0.5 means no jserver). Is there a simple way to do
>this? Help.
>
>Thanks.
If you have a webserver and a cgi-bin/whatever that can send mail - you can do this.
suppose the following html form worked:
<form action=http://server/cgi-bin/do_email> <input type=text name=to> <input type=text name=from> <input type=text name=subj> <input type=text name=body> <input type=submit> </form>
then:
utl_http.request(
'http://server/cgi-bin/do_email?to=x@y&from=a@b&subj=Hello&body=message+here' );
will run it as well. If you don't want a general purpose "web service to send email", run a webserver on ip address 127.0.0.1 on the server an only the database server will be able to run the URL.
-- Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Mon Mar 11 2002 - 14:54:28 CST