in reply to Re: DB2 checking for an error on select
in thread DB2 checking for an error on select
The problem with this is that when fetch runs out of a data to return it hit the || and dies, or if not data was found the script then dies.$status = $sth->execute; print "Status = $status\n"; # the RC is always -1 weather the execute + worked or not my $col1; $sth->bind_col(1,\$col1); while ($sth->fetch || die "Cant fetch data - $DBI::errstr\n") { print "ID: $col1\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: DB2 checking for an error on select
by morgon (Priest) on May 13, 2009 at 10:52 UTC | |
by dgarnier (Novice) on May 13, 2009 at 15:21 UTC | |
by morgon (Priest) on May 15, 2009 at 12:04 UTC | |
by dgarnier (Novice) on May 15, 2009 at 13:31 UTC |