Hi, I wonder if I might tap the vast knowledge here againg.

I have a perl script that is looping through a statement handle like this.

$statement = "select * from sometable";
$sth=$dbh->prepare($statement);
$sth->execute();

# here is the part I have a question about.
while (%hash_ref = %{$sth->fetchrow_hashref}) {
    
    while (($k,$v) = each (%hash_ref)) {
        print ("\n$k == $v"); }
}

The problem is that when I have exhausted the statement handle in the first
while statement I get this error.

DBD::Pg::st fetchrow_array failed: no statement executing

It's not fatal, but it is filling my error log. Is there a way I can suppers
this?

Does it hurt anything for me to be loop through the statement like this?


Thanks in advance
Jeff Seese

Reply via email to