fetchrow_array warning and error in cleanup




Happy New Year to you all,

I am quite new to using DBI and am running into something odd.

I'm using Perl 5.6.0 build 623 (Activestate), DBI 1.48 and DBD-ORACLE
1.12 on a Windows XP box. Not exactly the newest versions, I know, but
the company I work for is quite paranoid when it comes to using "new"
software, so I'm afraid that I'm stuck with these versions.

On my PC I have installed Oracle Client 10.1 and I am connecting to a
database server running Oracle 10g. The connection works fine and I can
perform queries.

So far so good. The issue is that at the end of each query, after that
last record has been fetched, I get the following warning:

DBD::Oracle::st fetchrow_array warning: (err=0, errstr=undef,
state=undef) at C:\<path_to_script>.pl line <linenumber>.

Then at the very end of the script, even after the disconnect, I get:

(in cleanup) Can't call method "FETCH" on an undefined value at
C:/Perl/site/lib/Win32/TieRegistry.pm line 1486 during global
destruction.


Stripped down to the bare minimum the script looks like this:

use DBI;

my $datasource = "dbi:Oracle:mydatabase";
$user='myuser';
$password='mypassword';

$dbh = DBI->connect($datasource, $user, $password) or die "Couldn't
connect to database: " . DBI->errstr;

$sql = q{
SELECT col_a, col_b
from mytable
};

$sth = $dbh->prepare($sql);

$sth -> execute;

while (my @results = $sth->fetchrow_array()) {
print "$results[0], $results[1]\n";
}

$sth->finish;

$dbh->disconnect;

I'm lost. The database connection and queries seem to be working fine,
but the warnings are extremely annoying.
Any help would be highly appreciated.

Best regards,
Kees Couprie
.



Relevant Pages

  • DBD::Sybase $dbh->clone errors...
    ... There are better ways to do the example included, but this is strictly for demonstration of the warning. ... The warning I get when running the script is: ... I'm not sure if the message is from DBI or from the DBD, ...
    (perl.dbi.users)
  • cant connected to DB
    ... I have simple script, trying to get connection to DB. ... use DBI; ... Keng Hee ...
    (perl.dbi.users)
  • Re: RDB limitations: from Jimmy Gavan
    ... Your DBI QUESTION: ... Bearing in mind no compiler to reference or even test my thoughts, ... The unique Id is used as a DB connection ... move SQLSTATE to MOST-SQLSTATE ...
    (comp.lang.cobol)
  • Re: DBD::CSV - UPDATE corrupts data!
    ... DBI 1.607, DBD::CSV 0.20, both runs deliver the same result from your first run. ... This are remnants from the shortening of the original program to generate a minimal test script. ... will try UPDATE Projects ...
    (perl.dbi.users)
  • RE: :Oracle - with ora10g oci.dll
    ... I agree it's not a DBD or DBI error. ... your connection descriptor seems suspect: ... how to get to our nameservers. ... 10g installation is really just a few files in the /perl/bin directory. ...
    (perl.dbi.users)