Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: how can I execute a perl cgi from pl/sql?
Hi Tamara
> I am looking for a way to execute a perl cgi from pl/sql in a
> transparent way.
> I know that if I want to execute another procedure from a procedure I
> just type the name of the procedure and pass the variables, but I
> haven't figured out how to execute a perl program.
>
> What I am trying to do is pass the variables from my plsql script to a
> sendmail cgi and I can do it using a web form, but that's noe what I
> want to do. Is there anyone who has done this before?
There is a way to do this, the suggestion I am about to make is dependant on you running a web server that can execute a perl script (I think on unix you can execute a perl script wothout running a web server.)
In Oracle 8 and above there is a package called UTL_HTTP, this enables you to call urls as urls are commonly called (eg through a web browser) passing parameters, you then recieve the results of that call in either a varchar2(2000) variable or a varchar2(2000) table(array).
All in all it is very simple, here is an example that calls a php3 script to send an email:
body long; --variable to hold body of email ht varchar2(2000); -- variable to hold results of http call -----------------------------------------------------------ht :=
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Mon Jul 19 1999 - 02:14:20 CDT