On Fri, Jul 16, 2004 at 03:41:15PM +0400, [EMAIL PROTECTED] wrote:
> 
> Hi,
> 
> just my 2 cents. How about something like this:
> 
>   while(($line = eval { $sth->fetchrow_arrayref() }) || $@)
>   {
>     next unless $line;
>     ...
>   }

Checking $sth->{Active} adds extra safety. Something like this:

  while(($row = eval { $sth->fetchrow_arrayref }) || ($@ && $sth->{Active})) {
    next unless $row;
    ..
  }

Tim.

> Vadim.
> 
> On Thu, 15 Jul 2004, 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, whereas I want to be able to terminate *one* row in the loop.
> > (and it seems to be overkill to wrap each call to fetchrow_arrayref() in an eval,
> > although I suppose I could do that..)
> > 
> > 
> > Thanks much,
> > 
> > Ed
> > 
> 

Reply via email to