[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] DBH statement isn't closing



I'm mucking around with DBI stuff for the first time.  I thought I did
everything right, but I guess I didn't.

Here is my code:
===============
#!/usr/bin/perl -w

use DBI;

my $cacheDB = DBI->connect("dbi:SQLite:waypoint.db","","") or die "Couldn't fin\
d cache database";

my $stmt = $cacheDB->prepare("Select lat,lon from waypoint where name=?");

$stmt->execute( ("Home") );
my ($lat,$lon);

$stmt->bind_columns(undef,\$lat,\$lon);

while ($stmt->fetch() ) {
 print "$lat\t$lon\n";
}

$stmt->finish();
$cacheDB->disconnect();
==========

I get the correct output, but I also get this warning:

closing dbh with active statement handles at dberror.pl line 19.

I thought I did close it with the finish method.  Maybe I didn't.

Anyone got an idea?




--
Mike Hostetler
http://mike.hostetlerhome.com/