Perl error: fetchrow_hashref failed

From: Jeffrey <seesej(at)uswest(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Perl error: fetchrow_hashref failed
Date: 2000-04-12 09:05:33
Message-ID: B5198A6D.2CB7%seesej@uswest.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gustavo Henrique 2000-04-12 10:02:08 recovery
Previous Message Manuel Cabido 2000-04-12 08:52:19 Re: foriegn key...