Re: apache2, DBD/Oracle problem

2002-08-16 Thread Stas Bekman
#x27;NLS_LANG'}\n"; > print "DSN=$dsn$ENV{'ORACLE_SID'}\n"; > > $dbh = DBI->connect("$dsn$ENV{'ORACLE_SID'}", $user, $password) > or die "Cannot connect: ".$DBI::errstr; > > $sth = $dbh->prepare($sql) > or die "

Re: apache2, DBD/Oracle problem

2002-08-16 Thread Atsushi Fujita
NV{'ORACLE_SID'}", $user, $password) or die "Cannot connect: ".$DBI::errstr; $sth = $dbh->prepare($sql) or die "Cannot prepare: ".$dbh->errstr(); $rv = $sth->execute or die "Cannot execute: ".$sth->errstr(); print "sth=$sth,rv=$rv\n

Re: apache2, DBD/Oracle problem

2002-08-16 Thread Stas Bekman
Atsushi Fujita wrote: > Hi Stas, > > >>Can you please try to convert the script into a mod_perl handler and >>test again? > > > OK, I just checked it. > The result was everything fine using by mod_perl handler! > There was no problem in my new code. > > ...But I want to use ModPerl::Registry,

Re: apache2, DBD/Oracle problem

2002-08-16 Thread Fredo Sartori
Hi, the problem connecting to an oracle DB through mod_perl is solved: the solution was, to convert the script into a mod_perl handler as it was suggested by Stas. I adopted the code posted by Atsushi Fujita and it worked just perfect for me. So, thank you all for your help. Fredo -- Dr. Fred

Re: apache2, DBD/Oracle problem

2002-08-15 Thread Atsushi Fujita
; $rv = $sth->execute or die "Cannot execute: ".$sth->errstr(); $r->print("sth=[$sth],rv=[$rv]\n"); while(@row = $sth->fetchrow_array){ $r->print("@row\n"); } $sth->finish(); $dbh->disconnect(); $r->print("Finished!!\n");

Re: apache2, DBD/Oracle problem

2002-08-15 Thread Stas Bekman
Mike P. Mikhailov wrote: > Hello Fredo Sartori, > > Thursday, August 15, 2002, 1:44:34 PM, you wrote: > > I mabe wrong, but what about to move code to setup ENV out from BEGIN > block ? I wrote simple test below: > > # Test.pm > package Test; > > use Apache::Constants qw ( :common ); > > BE

Re: apache2, DBD/Oracle problem

2002-08-15 Thread Mike P. Mikhailov
Hello Fredo Sartori, Thursday, August 15, 2002, 1:44:34 PM, you wrote: I mabe wrong, but what about to move code to setup ENV out from BEGIN block ? I wrote simple test below: # Test.pm package Test; use Apache::Constants qw ( :common ); BEGIN { $ENV{FOO1} = 'BAR1'; $ENV{FOO

Re: apache2, DBD/Oracle problem

2002-08-15 Thread Stas Bekman
Atsushi Fujita wrote: > Hi Lyle, > > >>I does seem to be an ORACLE environment issue. Can you please try to convert the script into a mod_perl handler and test again? I doubt this is registry problem, but probably something that about setting up the env for mod_perl in general. What would he

Re: apache2, DBD/Oracle problem

2002-08-15 Thread Atsushi Fujita
... By the way, is there anyone who is working DBD Oracle under mod_perl2? Thank you. Atsushi - Original Message - From: "Lyle Brooks" <[EMAIL PROTECTED]> To: "Atsushi Fujita" <[EMAIL PROTECTED]> Cc: "Fredo Sartori" <[EMAIL PROTECTED]>;

Re: apache2, DBD/Oracle problem

2002-08-15 Thread Lyle Brooks
I does seem to be an ORACLE environment issue. IIRC, the original post had the Oracle environment variables set in a BEGIN block. I ran into a similar issue, where I changed ORACLE_HOME and TNS_ADMIN to point to a new location. I set these in a BEGIN block in my startup.pl file. But the mod_pe

Re: apache2, DBD/Oracle problem

2002-08-15 Thread Atsushi Fujita
Hi Fredo, I had a similar problem in similar environment. My simple DBD program worked fine on normal shell and normal apache, but it didn't work under the mod_perl2. It showed error as following in apache error_log. [error_log] DBI->connect(ynt0) failed: (UNKNOWN OCI STATUS 1804) OCIIni

Re: apache2, DBD/Oracle problem

2002-08-15 Thread Fredo Sartori
Hello Mike, the code works from the shell as a regular perl script. The service is correctly resolved with tnsping. Fredo Am Don, 2002-08-15 um 10.05 schrieb Mike P. Mikhailov: > Hello Fredo Sartori, > > You are connecting to Oracle with service specified in connect > string. Does this service

Re: apache2, DBD/Oracle problem

2002-08-15 Thread Mike P. Mikhailov
Hello Fredo Sartori, You are connecting to Oracle with service specified in connect string. Does this service resolves correctly with tnsping ? Does this code work correctly as regular perl script ? Thursday, August 15, 2002, 1:44:34 PM, you wrote: FS> Hi, FS> I have problems connecting to a