Re: How to test status of handler sth?

From: Michael A Chase (mchase_at_ix.netcom.com)
Date: 10/24/03


Date: Fri, 24 Oct 2003 03:32:17 -0700 (PDT)
To: perl@swanmail.com

On Fri, 24 Oct 2003 02:17:31 -0700 (PDT) perl@swanmail.com wrote:

> I do know that it is a SELECT but I'm getting some kind of error on
> the fetch call. From this, I know there should be data but it's
> either failing or I lost the handle (sth). Though, I did some simple
> coding and found that it is not NULL (it is defined) but not
> fetching. And the code is crsahing

What error messages are you seeing? If you want help, you have to give
us something to work with.

The examples you gave were not testing for the result of the
operations. If you want your code to operate consistantly, you must
either set $dbh->{RaiseError} before you call prepare() or you must
check the result of each operation explicitly.

-- 
Mac :})
** I usually forward private questions to the appropriate mail list. **
Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.


Relevant Pages

  • Re: UPDATE: How to test status of handler sth?
    ... can't be called unless the variable $sth is a blessed statement handle ... established that $sth is still a blessed DBI statement handle. ... Give a hobbit a ring and he eats fish for an age. ...
    (perl.dbi.users)
  • Re: How to test status of handler sth?
    ... ifis not consistent when connection or something goes bad. ... Can you or someone comment further about testing $sth if there are rows? ... > Give a hobbit a ring and he eats fish for an age. ...
    (perl.dbi.users)
  • Re: How to test status of handler sth?
    ... > A scenario is that a $sth is passed from a sub. ... $sth will be false. ... Give a hobbit a ring and he eats fish for an age. ...
    (perl.dbi.users)
  • Re: How to test status of handler sth?
    ... Are you not just really worried about losing your connection and if so can ... >> portable way to tell if $sth will return rows is to fetch some. ... >> Give a hobbit a ring and he eats fish for an age. ...
    (perl.dbi.users)
  • Re: UNSUBSCRIBING
    ... Eventually the list admin ... I think it's been three months since the last such request. ... Give a hobbit a ring and he eats fish for an age. ...
    (perl.dbi.users)