Re: Retrying a fetch after an error, without restarting the whole loop?
- From: jonathan.leffler@xxxxxxxxx (Jonathan Leffler)
- Date: Wed, 8 Nov 2006 23:26:02 -0800
On 11/8/06, Bart Lateur <bart.lateur@xxxxxxxxxx> wrote:
I've been saving picture files that had been stored in a blob field in
an MS-Access database (aka an "OLE Object") to files, and I've bumped
onto some LongReadLen related problems: through trial and error I
finally succeeded in making LongreadLen long enough to reliable extract
all the files. (in Access, the function LEN on such a field reports a
size that's half the number of bytes. Apparently it mistakes it for
Unicode text. I haven't found a better suited function than LEN, though
I haven't searched hard).
Anyway; as this was a process of several minutes, it took some time to
fix the script and start all over.
So I was wondering these two things:
1) What's the best way to temporarily disable RaiseError when I want to
have it enabled for the rest of the script? Say, for one SQL statement?
$sth->{RaiseError} = 0;
Or:
$dbh->{RaiseError} = 0;
$dbh->do("something that might fail");
$dbh->{RaiseError} = 1;
And 2), in a fetch loop, is it possible to adjust a property like
{ReadLongLen}, and retry the same fetch without restarting the whole
loop? Because this error typically happened several minutes into the
loop.
Highly unlikely. The data has been fetched - and truncated. There's not
usually a way to refetch the same row - unless you have a scroll cursor, and
DBI doesn't have support for those.
--
Jonathan Leffler <jonathan.leffler@xxxxxxxxx> #include <disclaimer.h>
Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."
- Follow-Ups:
- Re: Retrying a fetch after an error, without restarting the whole loop?
- From: Bart Lateur
- Re: Retrying a fetch after an error, without restarting the whole loop?
- References:
- Retrying a fetch after an error, without restarting the whole loop?
- From: Bart Lateur
- Retrying a fetch after an error, without restarting the whole loop?
- Prev by Date: DBD Sybase make test errors
- Next by Date: MySQL server has gone away?
- Previous by thread: Retrying a fetch after an error, without restarting the whole loop?
- Next by thread: Re: Retrying a fetch after an error, without restarting the whole loop?
- Index(es):
Relevant Pages
|