On Thu, Jul 15, 2004 at 04:50:07PM -0700, Edward Peschko wrote:
> hey all,
>
> How do you make errors that are otherwise fatal, warnings?
>
> I'm getting an oracle error which I think is a oracle bug (01801), and only
> effects one row of an otherwise large, large table. I'd like to be able to trap
> the error, skip the row, and load the rest of the table.. eval doesn't work, because
>
> eval
> {
> while ($line = $sth->fetchrow_arrayref())
> {
> ...
> }
> }
>
> kills the whole loop,
Setting $sth->{RaiseError} = 0; will prevent the loop being _killed_
but not prevent it exiting.
On the other hand, just because the fetchrow_arrayref() returned false
doesn't mean you can't fetch more rows from it. Something like this
should work:
$sth->{RaiseError} = 0;
do {
while ($line = $sth->fetchrow_arrayref()) {
...
}
} while ($sth->{Active});
Tim.