Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: cgi gateway to oracle database
On Mon, 19 Apr 1999 22:11:15 GMT, hchen42j15_at_my-dejanews.com wrote:
>I had following problem when I tried to use DBI/DBD (DBI version 1.06, DBD
>version 0.60) to connect to Oracle database (version 7.3.4). The following
>script runs ok under Unix environment but fails when accessing through Web. It
>seems that the ora_login function fails. I appreciate if anyone can help
>me out.
>
>H. Chen
>
>-----------------------------
>#!/opt/pub/exptools/bin/perl
>
>use Oraperl;
>
>print "Content-type: text/plain", "\n\n";
>
>$lda = &ora_login ($system_id, "scott", "tiger");
># $system_id is the connecting string for the database
>
>$csr = &ora_open ($lda, " select sysdate from dual ");
>($sdate) = &ora_fetch ($csr);
>&ora_close ($csr);
>&ora_logoff ($lda);
>print "today is $sdate", "\n";
Check to make sure that ORACLE_HOME is available in your CGI environment, and that $ORACLE_HOME/bin is on the path.
Hint: If you're using Apache, look up PassEnv in the configuration.