[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    connect-error DBI::Oracle with mod_perl on Win-NT ( 2. )
From:       Lutz Kittler <Lutz.Kittler () sse-erfurt ! de>
Date:       1998-06-30 9:08:00
[Download RAW message or body]


Hi , 

Because nobody could help me I try to get an answer
with some more descriptions.

I had trouble using DBI with Oracle on Windows NT with
Apache and mod_perl.

I use the follwing versions :
Windows NT 4.0 SP3 , perl 5.004_04 ( GS-port )
Apache      1.3.0  , mod_perl    1.12
DBI         0.93   , DBD::Oracle 0.50

I tried the same things with DBI::Oracle 0.49 and mod_perl 1.11
I always get the same results.


I want to get some data from an oracle database by the following
perl script :

BEGIN{      # to make sure all variable are set
  $ENV{ORACLE_HOME}="d:\\orant.73";
  $ENV{ORACLE_SID}="ORCL";
#
  $ENV{DBI_TRACE}=1;
  $ENV{PERL_DBI_DEBUG}=1;
}

use DBI;
use DBD::Oracle;
use CGI qw(:standard);
print header,start_html('-title'=> "TEST HTML 1",'-BGCOLOR'=>'white');
$dbh=DBI->connect("dbi:Oracle:","scott","tiger");
print "<b>\nunable to connect $DBI::errstr\n</b>\n",end_html unless $dbh;


=======================================================
If  I execute this script as command or under apache
as cgi-script ( beginning with "#!c:\perl\bin\perl.exe )
everything is alright. I got the follwing debug output
when running as command:

DBI->connect(dbi:Oracle:, scott, tiger, , )
 at orax.pl line 13
DBI->install_driver(Oracle)
 at orax.pl line 13
DBI->install_driver(Oracle) loaded
 at orax.pl line 13
DBI->install_driver(Oracle) = DBI::dr=HASH(0xbe9854)
 at orax.pl line 13
DBI->connect using Oracle driver DBI::dr=HASH(0xbe9854)
    <- connect= DBI::db=HASH(0xc3ea48)
DBI->connect = DBI::db=HASH(0xc3ea48)
    <- STORE= 1
    <- STORE= 1
===============================================

If I try to use this script using modperl 
I have the following in my access.conf :

access.conf:

LoadModule perl_module modules/ApacheModulePerl.dll

Alias /perl/  c:/apache/perl/
<Location /perl>
SetHandler  perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>

The result I got is always $DBI::errstr="ORA-0...".
See the debug output below :
---------------------------------------------------
Loaded DBI.pm (debug 1)
 at c:/apache/perl/orax.pl line 8
    DBI dispatch debug level set to 1
DBI->install_driver(Oracle)
 at c:/apache/perl/orax.pl line 13
DBI->install_driver(Oracle) loaded
 at c:/apache/perl/orax.pl line 13
DBI->install_driver(Oracle) = DBI::dr=HASH(0xc76b4c)
 at c:/apache/perl/orax.pl line 13
DBI->connect(dbi:Oracle:, scott, tiger, , )
 at c:/apache/perl/orax.pl line 14
DBI->connect using Oracle driver DBI::dr=HASH(0xc76b4c)
    ERROR EVENT 0 'ORA-0: 
    (Text for error 0 not fetched. Use 'oerr ORA 0' command.)' 
        (Handlers: undef)
    <- connect= undef
    <- errstr= 'ORA-0: (Text for error 0 not fetched. 
        Use 'oerr ORA 0' command.)'
DBI->connect failed: ORA-0: (Text for error 0 not fetched. 
        Use 'oerr ORA 0' command.)
    <- DESTROY= undef
===============================================================================

I cannot see the difference between this calls.
As I know ORA-0 means "no error" thats why I don't know
why this results in an error.
There is no difference with mod_perl if I give a non-existent
database or user or a wrong password : I got "ORA-0".
With cgi or at commandline I will get the right ORA- or TNS errors.
Thats why I think there must be a configuration error in 
mod_perl. 

If I had to set something more/other in apache-configuration
please tell me.
Besides I dont know why DBI cannot fetch the error string 
for the error code.


   Thanks in advance

                Lutz

PS: If possible please answer also to 
	Lutz.Kittler@erfurt.thur.de.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic