in reply to DBD::AnyData error message for DBI handle

Yes, use $sth->{Active}=0; for now. I will release a new version of DBD::AnyData that makes this unecessary.
  • Comment on Re: DBD::AnyData error message for DBI handle

Replies are listed 'Best First'.
Re^2: DBD::AnyData error message for DBI handle
by bart (Canon) on Jun 13, 2005 at 17:58 UTC
    Shouldn't $sth->{Active} automatically be cleared when $sth->fetch returns undef, thus, when there are no more records to fetch?

    And shouldn't clearing $sth->{Active} be the same as calling $sth->finish?

    Quoting the DBI docs:

    Fetching all the data or calling $sth->finish sets Active off.
      Yes, that's the way it should work. However the old DBD::File got it wrong. Newer versions of DBD::File corrected it, and I just haven't released a newer DBD::AnyData to follow suit. In normal practice, one should never explicitly set $sth->{Active}, I'm only recommending it in this case as a temporary work around to shut off the annoying (but harmless) warning about Active handles in DESTROY. Alternate solutions would be to go back to an earlier DBD::FIle or to patch DBD::AnyData to remove the finish() and DESTROY() methods of ::st.