As you've discovered, $sth->finish doesn't quite do the job.  I've found if I 

undef $sth;

before disconnecting, it eliminates the message about closing $dbh with active 
statement handles.


----- Original Message ----
From: Brian Rowlands (Greymouth High School) <[EMAIL PROTECTED]>
Sent: Wednesday, October 10, 2007 1:48:49 AM
Subject: [sqlite] Most basic of questions

I'm absolutely new to sqlite which I'm using with a perl project. I did
a test script:

use strict;
use DBI;

my $dbfile = 'H:\trythis.s3db';

my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile","","",{RaiseError =>
my $sql = "SELECT name FROM Fields ORDER BY name";

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

if (defined($sth)) {
    $sth-> execute();
    my @row;
    while (@row = $sth->fetchrow_array()) {
        print "$row[0]\n";



Can someone kindly tell me why I get displayed: "closing dbh with
statement handles at H:\Testing line 25? By that I mean which it
is necessary to have it displayed? Does it have to be so or can I
somehow cause it not to appear?

I'm awaiting a book "The definitive guide to SQLite" to study but in
meantime I'd appreciate the help from some kind soul.

Brian Rowlands
We must accept finite disappointment, but we must never lose infinite
Martin Luther King Jr. </quotes/k/martinlutherking/>  

To unsubscribe, send email to [EMAIL PROTECTED]

Reply via email to