On Wed, 01 May 2002 16:04:05 -0400 Barbara Lindsey <[EMAIL PROTECTED]> wrote:
> Perl 5.00503 (site_perl 5.005)
> Linux 2.2.14
> Oracle 7.4.3
> Apache, but not mod_perl
> DBI.pm v.1.13
>
> I am getting an error at my DBI->connect statement.
> The original error in the log was 'DBI->connect failed: ORA-12154:
> TNS:could not resolve service na...'
Have you tried connecting with SQL*Plus in the same hose with the same
information?
sqlplus DBNAMESCHEMA/PASSWD@DNAME
> The part I cannot figure out is that in the log, it says:
> DBI::connect_test_perf('DBI', 'DBI:Oracle:DBNAME', 'DBNAMESCHEMA',
> 'PASSWD', 'HASH(0x837f440)')
>
> However, in my actual call to the connect_test_perf, I am using:
> DBI->connect_test_perf('DBI:Oracle:DBNAME', 'DBNAMESCHEMA',
> 'PASSWD',\%attr);
>
> For some reason it is inserting the extra 'DBI' at the beginning of the
> parameter list.
The leading DBI is the class associated with the method call:
"DBI->method". The "DBI" in "DBI:Oracle:DBNAME" is supposed to be
lowercase according to the documentation, but nothing inforces case
sensitivity like the driver name is ("dbi:oracle" would not work).
> I tried checking the environments being keyed with the DBI.pm module
> from my program, but the only one
> I found to be set from my program level is:
> $ENV{GATEWAY_INTERFACE} which is set to CGI/1.1
Try running the script from the commandline in the same account as the
webserver runs in. Compare the environment variables set in both
situations. DBI->trace(2, "filename") may reveal useful information as
well.
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.