in reply to Re^4: DB2 checking for an error on select
in thread DB2 checking for an error on select

fetch returns undef if either there are no more rows or when en error occurs.

You can distinguish these cases by checking $sth-err.

So in code you can do something like this:

while( defined $sth->fetch) { # do something with fetched data } if($sth->err) { # handle error } else { # no more data }

Replies are listed 'Best First'.
Re^6: DB2 checking for an error on select
by dgarnier (Novice) on May 15, 2009 at 13:31 UTC
    Thanks that did the trick