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

Home -> Community -> Usenet -> c.d.o.server -> Re: how can I execute a perl cgi from pl/sql?

Re: how can I execute a perl cgi from pl/sql?

From: <bonanos_at_yahoo.com>
Date: Mon, 19 Jul 1999 07:14:20 GMT
Message-ID: <7muj87$kih$1@nnrp1.deja.com>


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 :=
utl_http.request('http://www.my_site.co.za:85/mailresponse.php3?To='||ct o||'&Subject=%20Discussion:%20User%20Invitation'||'&Message='||body);

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

Original text of this message

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