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: embedded SQL

Re: embedded SQL

From: Richard J Woodland <richwoodland_at_interfacefamily.com>
Date: 1997/06/24
Message-ID: <33AFFD18.357B@interfacefamily.com>#1/1

Michael Polikoff wrote:
>
> I'm currently working on a databasing project in which I'm designing an
> applications interface in HTML. In order to interface with the database
> (Oracle), I need to write CGI scripts with embedded SQL. I know this
> can be accomplished with C or Visual Basic, but I don't have time to
> learn a new language. Does anyone know how this could be done with
> Perl?
>
> Desperate for any help anyone could give me -- even a link to a good
> source of info. Thanks.
>
> Mike Polikoff
> michael_at_uss.net
> mpolly_at_miint.net

You have (at least) two choices, a straight perl/sql*plus combination, or oraperl. You could also (potentially) use the odbc package for perl, and access oracle databases that way. However, my experience with the odbc is that it is painfully slow.

My preferred method, at least for the moment, is to use the first method. My cgi script is perl, it produces SQL queries in temporary files, uses the 'system' function to call sql*plus with the '@' to get the script from the temporary file. The script contains a SPOOL command to send the output to another temp file, which is read by the perl script, parsed and converted to an HTML response page. Sounds like a pain, but it's actually quite straighforward, in most cases.

Another alternative would be to use the Oracle Webserver, in which case you cgi scripts are in PL/SQL. The chief disadvantage I have found is that for dynamic SQL, I find it a little more difficult in PL/SQL than having it generated by perl. Another advantage of the perl option is that you have the full flexibility of perl in programming the solution.

Hope this helps.

If you need a simple example, just e-mail me at richwoodland_at_interfacefamily.com Received on Tue Jun 24 1997 - 00:00:00 CDT

Original text of this message

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