You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Aldo Luis Orsini <ao...@telecompersonal.com.ar> on 2001/01/31 21:46:09 UTC
Apache + Perl + Oracle
Help me please ...
I want connect to DB Oracle by emperl but i don't .
The results ... don´t show me errors, don´t show anything in variable (ej
[ +$campo1+])
My scritp is:
[!
#Variables de entorno
use DBI;
!]
[-
$db_user = 'xxx'; #DB_USER;
$db_passwd = 'yyy'; #DB_PASSWORD;
$db_id = 'ECOMM'; #SID;
$db_driver = "dbi:Oracle:";
$fields = '*'; #Campos de la tabla para el select;
$tabla = 'proveed'; #nombre de la tabla;
$where = ''; #clausula del where para el select;
-]
<html>
<head>
<title>
</title>
[- #Para que EmbPerl no escapee las comillas
$escmode = 0 -]
<meta HTTP-EQUIV="Expires" CONTENT="">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" link=FF0000 vlink=FF0000>
[-
#Armado de la query
#connect to database
$dbh = DBI->connect($db_driver . $db_id,$db_user,$db_passwd,{ AutoCommit => 0 });
#prepare the sql select
$sth = $dbh -> prepare ("SELECT $fields FROM $tabla");
#execute the query
$sth -> execute;
($campo1, $campo2, $campon) = $sth->fetchrow_array;
$sth->finish;
$dbh->disconnect();
-]
Corremos con DEBUG
<p>
dbh: [+ $dbh +]<br>
sth: [+ $sth +]<br>
Campo1: [+ $campo1 +]<br>
Campo2: [+ $campo2 +]<br>
Campon: [+ $campon +]<br>
</body>
</html>
My configuration is
Row Var Content
0 SERVER_SOFTWARE Apache/1.3.12 (Unix) mod_perl/1.22 mod_ssl/2.6.2 OpenSSL/0.9.5
1 DOCUMENT_ROOT /app/webs/acag/html
2 GATEWAY_INTERFACE CGI-Perl/1.1
3 ORACLE_PATH /app/oracle/product/8.1.6/bin:/app/oracle/product/8.1.6/obackup/bin:/opt/bin:/bin:/usr/bin
4 REMOTE_ADDR 10.101.3.147
5 REQUEST_METHOD GET
6 SESSION_FILE_LOCK 1
7 QUERY_STRING
8 HTTP_ACCEPT application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
9 ORACLE_BASE /app/oracle
10 REMOTE_PORT 3459
11 SERVER_ADDR 10.1.4.210
12 HTTP_ACCEPT_LANGUAGE es
13 MOD_PERL mod_perl/1.22
14 ORA_NLS32 /app/oracle/product/8.1.6/ocommon/nls/admin/data
15 nokeepalive 1
16 HTTPS on
17 ORA_NLS33 /app/oracle/product/8.1.6/ocommon/nls/admin/data
18 SCRIPT_FILENAME /app/webs/acag/html/min/trash/ambiente.epl
19 SERVER_NAME wwwserver1.telecompersonal.com.ar
20 SERVER_PORT 443
21 PATH_TRANSLATED /app/webs/acag/html/min/trash/ambiente.epl
22 ORACLE_HOME /app/oracle/product/8.1.6
23 SERVER_ADMIN root@server1b.telecompersonal.com.ar
24 SERVER_SIGNATURE <ADDRESS>Apache/1.3.12 Server at wwwserver1.telecompersonal.com.ar Port 443</ADDRESS>
25 SERVER_PROTOCOL HTTP/1.0
26 HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)
27 PATH /sbin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/bin/X11:/usr/local
28 ssl-unclean-shutdown 1
29 HTTP_CONNECTION Keep-Alive
30 SCRIPT_NAME /min/trash/ambiente.epl
31 ORACLE_SID ECOMM
32 SESSION_FILE_DIRECTORY /app/webs/acag/html/acag/sessions
33 REQUEST_URI /min/trash/ambiente.epl
34 HTTP_COOKIE num=banco000; SITESERVER=ID=3fda4ee64dc8ad5c13552b8412dae598; RMID=c82d480a3a6f0fd0
35 HTTP_HOST wwwserver1.telecompersonal.com.ar
What is wrong ? PLEASE ...
Thanks a lot;
Aldo Luis Orsini...
Buenos Aires
Argentina
Re: Apache + EmbPerl + Oracle (Don't output screem)
Posted by Gerald Richter <ri...@ecos.de>.
Hey,
instead of sending the same mail over and over again, what's about reading
the answers and trying it out (see my mail from 2/2/2001)
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
----- Original Message -----
From: "Aldo Luis Orsini" <ao...@telecompersonal.com.ar>
To: <em...@perl.apache.org>
Sent: Friday, February 09, 2001 1:00 PM
Subject: Apache + EmbPerl + Oracle (Don't output screem)
Help me please ...
I want connect to DB Oracle by emperl but i don't .
The results ... don´t show me errors, don´t show anything in variable (ej
[ +$campo1+])
My scritp is:
[!
#Variables de entorno
use DBI;
!]
[-
$db_user = 'xxx'; #DB_USER;
$db_passwd = 'yyy'; #DB_PASSWORD;
$db_id = 'ECOMM'; #SID;
$db_driver = "dbi:Oracle:";
$fields = '*'; #Campos de la tabla para el select;
$tabla = 'proveed'; #nombre de la tabla;
$where = ''; #clausula del where para el select;
-]
<html>
<head>
<title>
</title>
[- #Para que EmbPerl no escapee las comillas
$escmode = 0 -]
<meta HTTP-EQUIV="Expires" CONTENT="">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" link=FF0000 vlink=FF0000>
[-
#Armado de la query
#connect to database
$dbh = DBI->connect($db_driver . $db_id,$db_user,$db_passwd,{ AutoCommit
=> 0 });
#prepare the sql select
$sth = $dbh -> prepare ("SELECT $fields FROM $tabla");
#execute the query
$sth -> execute;
($campo1, $campo2, $campon) = $sth->fetchrow_array;
$sth->finish;
$dbh->disconnect();
-]
Corremos con DEBUG
<p>
dbh: [+ $dbh +]<br>
sth: [+ $sth +]<br>
Campo1: [+ $campo1 +]<br>
Campo2: [+ $campo2 +]<br>
Campon: [+ $campon +]<br>
</body>
</html>
My configuration is
Row Var Content
0 SERVER_SOFTWARE Apache/1.3.12 (Unix) mod_perl/1.22 mod_ssl/2.6.2
OpenSSL/0.9.5
1 DOCUMENT_ROOT /app/webs/acag/html
2 GATEWAY_INTERFACE CGI-Perl/1.1
3 ORACLE_PATH
/app/oracle/product/8.1.6/bin:/app/oracle/product/8.1.6/obackup/bin:/opt/bin
:/bin:/usr/bin
4 REMOTE_ADDR 10.101.3.147
5 REQUEST_METHOD GET
6 SESSION_FILE_LOCK 1
7 QUERY_STRING
8 HTTP_ACCEPT application/vnd.ms-excel, application/msword,
application/vnd.ms-powerpoint, image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*
9 ORACLE_BASE /app/oracle
10 REMOTE_PORT 3459
11 SERVER_ADDR 10.1.4.210
12 HTTP_ACCEPT_LANGUAGE es
13 MOD_PERL mod_perl/1.22
14 ORA_NLS32 /app/oracle/product/8.1.6/ocommon/nls/admin/data
15 nokeepalive 1
16 HTTPS on
17 ORA_NLS33 /app/oracle/product/8.1.6/ocommon/nls/admin/data
18 SCRIPT_FILENAME /app/webs/acag/html/min/trash/ambiente.epl
19 SERVER_NAME wwwserver1.telecompersonal.com.ar
20 SERVER_PORT 443
21 PATH_TRANSLATED /app/webs/acag/html/min/trash/ambiente.epl
22 ORACLE_HOME /app/oracle/product/8.1.6
23 SERVER_ADMIN root@server1b.telecompersonal.com.ar
24 SERVER_SIGNATURE <ADDRESS>Apache/1.3.12 Server at
wwwserver1.telecompersonal.com.ar Port 443</ADDRESS>
25 SERVER_PROTOCOL HTTP/1.0
26 HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)
27 PATH /sbin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/bin/X11:/usr/local
28 ssl-unclean-shutdown 1
29 HTTP_CONNECTION Keep-Alive
30 SCRIPT_NAME /min/trash/ambiente.epl
31 ORACLE_SID ECOMM
32 SESSION_FILE_DIRECTORY /app/webs/acag/html/acag/sessions
33 REQUEST_URI /min/trash/ambiente.epl
34 HTTP_COOKIE num=banco000;
SITESERVER=ID=3fda4ee64dc8ad5c13552b8412dae598; RMID=c82d480a3a6f0fd0
35 HTTP_HOST wwwserver1.telecompersonal.com.ar
What is wrong ? PLEASE ...
Thanks a lot;
Aldo Luis Orsini...
Buenos Aires
Argentina
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Apache + Perl + Oracle
Posted by Gerald Richter <ri...@ecos.de>.
Hi,
at the first glance the code seems to be ok. Either your table is empty or
there is an Error you don't see. You could set DBI -> trace (1) to generate
a trace of DBI calls and see what happens
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
----- Original Message -----
From: "Aldo Luis Orsini" <ao...@telecompersonal.com.ar>
To: <em...@perl.apache.org>
Sent: Friday, February 02, 2001 1:02 PM
Subject: Apache + Perl + Oracle
Help me please ...
I want connect to DB Oracle by emperl but i don't .
The results ... don´t show me errors, don´t show anything in variable (ej
[ +$campo1+])
My scritp is:
[!
#Variables de entorno
use DBI;
!]
[-
$db_user = 'xxx'; #DB_USER;
$db_passwd = 'yyy'; #DB_PASSWORD;
$db_id = 'ECOMM'; #SID;
$db_driver = "dbi:Oracle:";
$fields = '*'; #Campos de la tabla para el select;
$tabla = 'proveed'; #nombre de la tabla;
$where = ''; #clausula del where para el select;
-]
<html>
<head>
<title>
</title>
[- #Para que EmbPerl no escapee las comillas
$escmode = 0 -]
<meta HTTP-EQUIV="Expires" CONTENT="">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" link=FF0000 vlink=FF0000>
[-
#Armado de la query
#connect to database
$dbh = DBI->connect($db_driver . $db_id,$db_user,$db_passwd,{ AutoCommit
=> 0 });
#prepare the sql select
$sth = $dbh -> prepare ("SELECT $fields FROM $tabla");
#execute the query
$sth -> execute;
($campo1, $campo2, $campon) = $sth->fetchrow_array;
$sth->finish;
$dbh->disconnect();
-]
Corremos con DEBUG
<p>
dbh: [+ $dbh +]<br>
sth: [+ $sth +]<br>
Campo1: [+ $campo1 +]<br>
Campo2: [+ $campo2 +]<br>
Campon: [+ $campon +]<br>
</body>
</html>
My configuration is
Row Var Content
0 SERVER_SOFTWARE Apache/1.3.12 (Unix) mod_perl/1.22 mod_ssl/2.6.2
OpenSSL/0.9.5
1 DOCUMENT_ROOT /app/webs/acag/html
2 GATEWAY_INTERFACE CGI-Perl/1.1
3 ORACLE_PATH
/app/oracle/product/8.1.6/bin:/app/oracle/product/8.1.6/obackup/bin:/opt/bin
:/bin:/usr/bin
4 REMOTE_ADDR 10.101.3.147
5 REQUEST_METHOD GET
6 SESSION_FILE_LOCK 1
7 QUERY_STRING
8 HTTP_ACCEPT application/vnd.ms-excel, application/msword,
application/vnd.ms-powerpoint, image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*
9 ORACLE_BASE /app/oracle
10 REMOTE_PORT 3459
11 SERVER_ADDR 10.1.4.210
12 HTTP_ACCEPT_LANGUAGE es
13 MOD_PERL mod_perl/1.22
14 ORA_NLS32 /app/oracle/product/8.1.6/ocommon/nls/admin/data
15 nokeepalive 1
16 HTTPS on
17 ORA_NLS33 /app/oracle/product/8.1.6/ocommon/nls/admin/data
18 SCRIPT_FILENAME /app/webs/acag/html/min/trash/ambiente.epl
19 SERVER_NAME wwwserver1.telecompersonal.com.ar
20 SERVER_PORT 443
21 PATH_TRANSLATED /app/webs/acag/html/min/trash/ambiente.epl
22 ORACLE_HOME /app/oracle/product/8.1.6
23 SERVER_ADMIN root@server1b.telecompersonal.com.ar
24 SERVER_SIGNATURE <ADDRESS>Apache/1.3.12 Server at
wwwserver1.telecompersonal.com.ar Port 443</ADDRESS>
25 SERVER_PROTOCOL HTTP/1.0
26 HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)
27 PATH /sbin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/bin/X11:/usr/local
28 ssl-unclean-shutdown 1
29 HTTP_CONNECTION Keep-Alive
30 SCRIPT_NAME /min/trash/ambiente.epl
31 ORACLE_SID ECOMM
32 SESSION_FILE_DIRECTORY /app/webs/acag/html/acag/sessions
33 REQUEST_URI /min/trash/ambiente.epl
34 HTTP_COOKIE num=banco000;
SITESERVER=ID=3fda4ee64dc8ad5c13552b8412dae598; RMID=c82d480a3a6f0fd0
35 HTTP_HOST wwwserver1.telecompersonal.com.ar
What is wrong ? PLEASE ...
Thanks a lot;
Aldo Luis Orsini...
Buenos Aires
Argentina
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org